in reply to Re^2: Change decimal point temporarily
in thread Change decimal point temporarily
use Scalar::Util qw( looks_like_number ); my $s = 123.45; $s =~ s/\./,/ if looks_like_number($s);
Works even better than setlocale because you are surely starting with the number in string form if you don't know whether a column contains a number or not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Change decimal point temporarily
by Jenda (Abbot) on Aug 02, 2010 at 23:05 UTC | |
by ikegami (Patriarch) on Aug 02, 2010 at 23:35 UTC | |
by lima1 (Curate) on Aug 03, 2010 at 00:32 UTC | |
by ikegami (Patriarch) on Aug 03, 2010 at 02:40 UTC |