Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Doing a BigDecimal.ROUND_HALF_UP without using BigDecimal

807569Aug 9 2006 — edited Aug 9 2006
Hi guys , is it possible to perform a round half up (like bigdecimal's function but without using BigDecimal.

I am trying to calculate a sales tax and the rounding rules states that for a tax rate of n%, a shelf price of p contains
(np/100 rounded up to the nearest 0.05) amount of sales tax. so a product costing 14.99 with 10% tax will therefore cost 16.49

I can get it done using BigDecimal's round half up function but i need to do it without using bigdecimal.

Any thoughts ?

Cheers.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2006
Added on Aug 9 2006
2 comments
401 views