Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by rjt (Curate)
on Oct 21, 2019 at 10:07 UTC ( #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
Node Status?
node history
Node Type: note [id://11107754]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2020-04-10 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (49 votes). Check out past polls.

    Notices?