Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Padding with sprintf changing number

by syphilis (Archbishop)
on Sep 27, 2021 at 14:26 UTC ( [id://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 surveying the Monastery: (3)
As of 2024-04-25 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found