September 6, 2004 at 6:19 am
Hi,
I would like to have 2 digits to the right of the decimal point, but I cannot do this.
Convert(money, (SUM(CASE WHEN SHKZG = 'S' THEN DMBTR *(-1) ELSE DMBTR END)), 0)
I set types 0, but I have always 4 digits, e. i. 172670.8839-->172670.88
Why? Could I try any other options?
Thanks
September 6, 2004 at 11:54 pm
Hi,
did you try already this ?
CAST(expression AS DECIMAL (10,2))
10 = Number of digits in a number
2 = Number of digits right after the decimal point
Regards,
Jan
September 6, 2004 at 11:57 pm
Money Datatype always has four digits to the right of the decimal place.
Jan's example above of using DECIMAL (x,2) will reduce the number of decimal places.
Julian Kuiters
juliankuiters.id.au
September 7, 2004 at 1:14 am
And why
In the following table, the column on the left represents the style value for money or smallmoney conversion to character data.
Value | Output |
---|---|
0 (default) | No commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 4235.98. |
1 | Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92. |
2 | No commas every three digits to the left of the decimal point, and four digits to the right of the decimal point; for example, 4235.9819. |
thanks
September 7, 2004 at 7:41 am
Yes,
thank you, that is what I need.
zdenek
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply