Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Padding with sprintf changing number

by syphilis (Archbishop)
on Sep 27, 2021 at 14:26 UTC ( #11137041=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    print  "$padamnt i m checking amount after padding,\n";
     return $padamnt;
    }
    
  2. or download this
     Checking amnt before conversion 4887.15,
     Checking amnt after rounding 4887.15,
    ...
    Checking the EXACT value of amnt: 488714.99999999994
    488714 i m checking amount before padding,
    0000000000488714 i m checking amount after padding,
    
  3. or download this
    $ python3 -c "print(4887.15 * 100)"
    488714.99999999994
    
    $ raku -e "say 4887.15e0 * 100"
    488714.99999999994
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-12-06 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (29 votes). Check out past polls.

    Notices?