no money data type

Post Reply
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

no money data type

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??
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

no money data type

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

no money data type

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.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

no money data type

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.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

no money data type

Post by mark »

%.2f should work in any sprintf variant.
Post Reply