1. rounding up number?

hi guys...
i have problem about rounding up.
this is my value 38495 . i want to rounding up that value to 38500.
how to do that?

2. Re: rounding up number?

MsgBox -Int(-38495 / 100) * 100

Int always rounds down, so by making a value negative it rounds it down making the value bigger (greater negative).

3. Re: rounding up number?

ok thanks. but when the value is 38403 it become 38500. why ?

4. Re: rounding up number?

It always rounds up. If you don't want that, then you need a different kind of rounding.

Bankers' rounding: MsgBox Round(38403 / 100, 0) * 100

Regular rounding: MsgBox Int(38403 / 100 + 0.5) * 100

The difference with bankers' and regular rounding is how they handle rounding numbers such as 0.5, 1.5, 2.5 - regular goes always up, bankers' goes up or down depending on whether the number is odd or even.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured