From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
John Townsend
Sent: Wednesday, 20 June 2007 10:50 a.m.
To: perl-win32-users@listserv.activestate.com
Cc: Chad Freeman
Subject: Truncating decimal number



I'm trying to truncate a number, 10.25233006477356, to 6 decimal points.
E.g. 10.252330. 

I don't need to round the number, I just want it to drop everything
after the 6th decimal point. This should be easy, but I'm drawing a
blank.

Thanks  

Working with strings is probably the most natural way. Convert to a
string and peel off the string as far as the 6th DP as people are
suggesting. However, mathematically speaking, subtracting 0.000 000 5
from the number and then rounding should work exactly the same.

Hope that helps

 

Brian Rowlands

 

 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to