John, Have you thought of using the SPRINTF function?
e.g.:
my $temp1 = 10.25233006477356;
my $temp2 = sprintf("%.6f", $temp1);
print $temp2;
>> 10.252330
I realize that the SPRINTF will round, but "not needing" and "not wanting"
are two different situations. I use this function all the time, and it is
easy to implement. If you do not "want" to round, than I don't know.
Regards,
Michael Cohen
"John Townsend"
<[EMAIL PROTECTED]
om> To
Sent by: <[EMAIL PROTECTED]
perl-win32-users- ate.com>
[EMAIL PROTECTED] cc
ActiveState.com Chad Freeman <[EMAIL PROTECTED]>
Subject
Truncating decimal number
06/19/2007 06:50
PM
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 _______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
<<inline: graycol.gif>>
<<inline: pic01763.gif>>
<<inline: ecblank.gif>>
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
