Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Answer: How do i round a generated number in Perl? ...math.round (as in javascript) ...?

by lhoward (Vicar)
on Jul 26, 2000 at 00:27 UTC ( #24344=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $rounded=100*int(0.5+$number/100);
    
  2. or download this
    $rounded=0.1*int(0.5+$number/0.1);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-12-28 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls