in reply to Re: Numbers aren't averaging correctly
in thread Numbers aren't averaging correctly
$elem =~ s/[^\d+-e.]//g;
This will remove any char that is not a digit, a +, a -, an 'e' (for numbers like 2e+31), or a point (.).
Or, even better, use Number::Format:
use Number::Format; $elem = unformat_number($elem);
This is especially useful if an array is used instead of the $se# notation. You'd access each one through $se[#] instead, and you could do this:
for (@se) { $_ = $unformat_number($_) }
|
|---|