Just to take it farther... to undo this, you could:
s/([\.\d]+)e\(?([-+]?\d+)\)?/$1*10**$2/egi;
I would rather have the notation given as 1.2234e+2, simply because Perl sees that as a number. By that I mean if you:
my $foo = 1.2234e(+2);
Perl will complain. If you do the following, it won't:
my $foo = 1.2234e+2;
The above RE should handle both cases. This is fun though..
$_=sprintf("%#1.4e",122.34);
print;
s/([\.\d]+)e\(?([-+]?\d+)\)?/$1*10**$2/egi;
print $/;
print;
Cheers,
KM |