Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Rounding off the scale value after decimal point

by venu_hs (Novice)
on Sep 21, 2012 at 08:27 UTC ( #994850=note: print w/ replies, xml ) Need Help??


in reply to Re: Rounding off the scale value after decimal point
in thread Rounding off the scale value after decimal point

Thank you monks for your responses. I dont want to round off the number. So i started using bignum module to specify the precision as 17. So if a number is actually 500.123, as per the precision of 17, it becomes 500.12300000000000000 which is ideal and intended. But then i would need it as 500.123 Any other perl modules i can use to accomodate this scenario.


Comment on Re^2: Rounding off the scale value after decimal point
Re^3: Rounding off the scale value after decimal point
by Anonymous Monk on Sep 21, 2012 at 22:19 UTC

    But then i would need it as 500.123 Any other perl modules i can use to accomodate this scenario.

    How odd, either you want the precision or you don't

Re^3: Rounding off the scale value after decimal point
by Anonymous Monk on Sep 22, 2012 at 09:06 UTC
    You can squash trailing zeros with  $num =~ s/0+$//;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-09-20 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (157 votes), past polls