in reply to Want to Truncate A Number... NOT round it
my $n=34.57889; my $na=substr($n,0,index($n,'.') + 1 + 3); print "$n $na\n"; __END__ 34.57889 34.578
Note the "3" is for the number of digits after the decimal "." you want to display.
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Want to Truncate A Number... NOT round it
by Anonymous Monk on Feb 11, 2004 at 20:37 UTC | |
|
Re^2: Want to Truncate A Number... NOT round it
by Siddhartha_90 (Initiate) on May 30, 2014 at 02:17 UTC |