Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Floats with trailing zeros as a hash key

by cbro (Pilgrim)
on May 09, 2003 at 16:51 UTC ( [id://256930]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $key1 = sprintf "%.2f", 45.20;
    my %ITEMS = ( $key1 => 'item 1');
    
  2. or download this
    $key1 = sprintf "%.2f", 52.30;
    my %ITEMS = (
    ...
    if (exists $ITEMS{$input}) {
        print $ITEMS{$input} . "\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2024-04-16 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found