in reply to Re: Numbers aren't averaging correctly
in thread Numbers aren't averaging correctly
It doesn't really just make a guess. It grabs all the numeric value it can find from the front of the string, and truncates anything past that. You can see the effect in action:
my @strings = qw( 2,300 2.54xyz123 2e32abc3 2.34,23 ); for (@strings) { print "$_ => ", 0+$_, "\n"; }
This prints:
2,300 => 2 2.54xyz123 => 2.54 2e32abc3 => 2e+32 2.34,23 => 2.34
|
|---|