Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Issue while reading decimal number from a Spreadsheet using perl

by rjt (Curate)
on Oct 21, 2019 at 10:07 UTC ( [id://11107754]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -le 'printf "%.18f", 10.1'
    10.099999999999999645
    
  2. or download this
        # Fix for Perl and sprintf not rounding up like Excel.
        # http://rt.cpan.org/Public/Bug/Display.html?id=45626
        if ( $data =~ /^${number_result}5/ ) {
    ...
                sprintf "%0${str_length}.${after_decimal}f",
                $data . '1';
        }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found