|
-
Dec 18th, 2002, 05:59 AM
#1
Thread Starter
Hyperactive Member
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!
-
Dec 18th, 2002, 06:12 AM
#2
Fanatic Member
-
Dec 18th, 2002, 07:23 AM
#3
Thread Starter
Hyperactive Member
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.
-
Dec 18th, 2002, 08:53 AM
#4
in that case... where "dp" is the number of decimal places:
int(12.6549 * (10^ dp) ) / (10^ dp)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|