|
|
Archives of the TeradataForum
Message Posted: Fri, 25 Feb 2011 @ 14:25:29 GMT
Subj: | | Re: Decimal display problem |
|
From: | | Singh, Sudhansu |
The expression with in the cast is integral meaning involves integers result will also have a integer.
One of the operational value should be decimal. Below is the demonstration:
sel cast((100/3) as decimal(6,3));
33.000
sel cast((100.0/3) as decimal(6,3));
33.300
sel cast((100.00/3) as decimal(6,3));
33.330
sel cast((100.000/3) as decimal(6,3));
33.333
sel cast((100.0000/3) as decimal(6,3));
33.333
sel cast((cast(100 as decimal(6,3))/3) as decimal(6,3));
33.333
regards,
Sudhansu
| |