I've added one more step to also catch the API returning an integer. This is now my implementation:
$from_api .= '.' unless $from_api =~ /\./; $from_api .= '00'; $from_api =~ s,^(\d+)\.(\d{2}).*$,${1}${2},; $from_api += 0;
This catches all corner cases I can think of.
In reply to Re^2: number comparison with a twist
by anotherguest
in thread number comparison with a twist
by anotherguest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |