in reply to Formatting numbers

You could use a RE, which may not be the best approach. But here it is anyway, and it seems to work great. :)

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