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
In reply to Re: Want to Truncate A Number... NOT round it
by liz
in thread Want to Truncate A Number... NOT round it
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |