use strict; use warnings; while ( <DATA> ) { chomp; print "$_ => "; s/(?<=\.)(.+?)0+$/$1/; print "$_\n"; } __DATA__ 1.25000000 4.60 8.0990010000 25
Much ado about nothing though, strings can be numified just by using them as numbers.
Dave
In reply to Re: Formatting numbers
by davido
in thread Formatting numbers
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |