Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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
Domain Nodelet?
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 surveying the Monastery: (2)
As of 2023-06-06 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (26 votes). Check out past polls.

    Notices?