-
MiniMe
- Posts: 210
- Joined: Thu Mar 15, 2001 4:30 pm
Post
by MiniMe »
Since there is no money data type is there an easy way to convert 16.299999 to 16.29 during the select statement??
-
Kai
- Site Admin
- Posts: 1272
- Joined: Tue Apr 25, 2000 1:27 pm
Post
by Kai »
You can convert it when you print it in Vortex (after the SELECT):
<fmt "%1.2lf" $value>
or better yet:
<fmt "%1.2klf" $value>
which will print commas every factor of 1000.
-
MiniMe
- Posts: 210
- Joined: Thu Mar 15, 2001 4:30 pm
Post
by MiniMe »
actually I am writing this in perl so I was hoping to be able to do it in the select statement. I will use sprintf in perl. thanks.
-
mark
- Site Admin
- Posts: 5519
- Joined: Tue Apr 25, 2000 6:56 pm
Post
by mark »
Use fmt %.2f when displaying the number. 16.29999999 would be properly displayed as 16.30 .
Or use integers and convert to string and insert decimal point when displaying.
-
mark
- Site Admin
- Posts: 5519
- Joined: Tue Apr 25, 2000 6:56 pm
Post
by mark »
%.2f should work in any sprintf variant.