Your skill will accomplishwhat the force of many cannot PerlMonks

### Re^2: Best way to round a number.

 on Oct 25, 2012 at 00:37 UTC ( #1000741=note: print w/replies, xml ) Need Help??

in reply to Re: Best way to round a number.
in thread Best way to round a number.

Alright, forget the multiple of 5 thing, its to the nearest 5 per say; therefore 33, should go to 30 because of the logic on the sample code I gave here, if the last number in this case is 3 (from 33), is less than five it should go to 30. So number 11 should go down to 10, 17 should round up to 20, I hope I am a lil clear on that now, thanks!

Replies are listed 'Best First'.
Re^3: Best way to round a number.
by BrowserUk (Pope) on Oct 25, 2012 at 00:55 UTC
I hope I am a lil clear on that now, thanks!

Not really. Are you saying that

1. if it is less that xx5, it rounds down.
2. if it is greater than xx5 it rounds up.
3. But if it is equal to xx5, it stays as is?

If so, that is a very peculiar rounding mode?

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Best way to round a number.
by ajam (Acolyte) on Oct 25, 2012 at 02:40 UTC

How is 33 closer to 30 than to 35?

30 31 32 33 34 35

I count two numbers between 30 and 33, but only one number between 33 and 35. Clearly 33 is closer to 35.

Create A New User
Node Status?
node history
Node Type: note [id://1000741]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-22 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
World peace can best be achieved by:

Results (163 votes). Check out past polls.

Notices?