Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: number comparison with a twist

by hippo (Bishop)
on Mar 02, 2020 at 14:08 UTC ( [id://11113632]=note: print w/replies, xml ) Need Help??


in reply to number comparison with a twist

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]);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found