-
Fix, round etc....
Hi,
Is there a function for cutting off a number at a specified number of decimals, rather than rounding it?
If my number is:
x = 12.6549
How can I return it to only 2,3 or whatever specified number of decimal places, like 12.6?
Fix(x) only returns the integer part.
Thanks for any help!
-
just a suggestion - could you not use the format function
ie
Format(12.6549, "00.0")
;)
I think thats the right syntax
-
No format doesn't work. Still rounds it off
eg:
dim number as double
number=4.568972
picture1.print Format(number, "0.0")
This will print 4.6, rather than 4.5
Thanks anyway.
-
in that case... where "dp" is the number of decimal places:
int(12.6549 * (10^ dp) ) / (10^ dp)