Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: rounding to nearest

by dws (Chancellor)
on Mar 22, 2003 at 10:15 UTC ( [id://245118]=note: print w/replies, xml ) Need Help??


in reply to rounding to nearest

how can i round a variable (lets say $price = 418.00 ;) to the nearest 10 ie '420.00'

Be aware that in certain situations it's considered bad form to pretend to maintain precision at the hundredth level when you've just rounded the nearest 10. You might want to clarify whether '418.00' rounds to '420.00' or '420'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-24 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found