I'd go the other way - converting the int to a string.
use strict; use warnings; use Data::Dumper; use Test::More tests => 1; my $num1 = 1990; my $num2 = '19.90'; $num1 = sprintf ("%.2f", $num1 * 0.01); is $num1, $num2; diag Dumper ([$num1, $num2]);
In reply to Re: number comparison with a twist
by hippo
in thread number comparison with a twist
by anotherguest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |