Can someone explain CAST(eExp as Numeric) to me? -
03-29-2005
, 03:15 PM
Hi all,
Could someone explain me why CAST() keeps the full precision in the
variable although I tell him not to?
Example:
SET DECIMALS TO 3
d1 = 12.111 && store with decimal
d2 = CAST(d1 as Numeric(8, 1)) && should remove decimal
d3 = TRANSFORM(d2) && ok decimal gone
d4 = TRANSFORM(d2, "") && decimal again????
WAIT WINDOW d1 && 12,111
WAIT WINDOW d2 && 12,1
WAIT WINDOW d3 && 12,1
WAIT WINDOW d4 && 12,111 && <-- ???????????????
Shoudn't d4 be 12,100 ?
* I can get rid of the decimal part with:
d5 = VAL(TRANSFORM(d2))
d6 = TRANSFORM(d5, "")
WAIT WINDOW d5 && 12,100
WAIT WINDOW d6 && 12,100
ROUND() can't specify the number of digits to the left of the decimal
point, so it's not what I want.
Thanks in advance,
Pedro Alves |