Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6079757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:59:00+00:00 2026-05-23T10:59:00+00:00

Rounding Issue For Example 598.59 ya 591.45 to be convert 600. 541.0 to be

  • 0

Rounding Issue

For Example

  1. 598.59 ya 591.45 to be convert 600.
  2. 541.0 to be convert 550.
  3. 541.59 to be convert 550.

    Just check the last 2 digit ignore the
    decimal value. if last 2 digit in
    between 11- 19 it will converted 20 if
    21-29 then will converted 30 and so on..

So What can i do for this.
Need ur Help.

thanks in advance….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:59:01+00:00Added an answer on May 23, 2026 at 10:59 am

    Use MathUtils [Commons Math] :
    – static double round(double x, int scale) or
    – static double round(double x, int scale, int roundingMethod)

    MathUtils.round(598.59, -1); // 600.0
    MathUtils.round(591.45, -1, BigDecimal.ROUND_CEILING); // 600.0
    MathUtils.round(541.0, -1, BigDecimal.ROUND_CEILING); // 550.0
    MathUtils.round(541.59, -1, BigDecimal.ROUND_CEILING); // 550.0
    

    For update in question

    Just check the last 2 digit ignore the
    decimal value. if last 2 digit in
    between 11- 19 it will converted 20 if
    21-29 then will converted 30 and so
    on..

    MathUtils.round((double) 111, -1, BigDecimal.ROUND_UP); // 120.0
    MathUtils.round((double) 119, -1, BigDecimal.ROUND_UP); // 120.0
    MathUtils.round((double) 121, -1, BigDecimal.ROUND_UP); // 130.0
    MathUtils.round((double) 129, -1, BigDecimal.ROUND_UP); // 130.0
    

    Cast to double to make sure round(double x, ...) is use, instead of round(float x, ...).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue with rounding the result of a calculation to two decimal
If I issue: (set-option :pp-decimal true) (set-option :pp-decimal-precision 10) Does Z3 do any rounding
I have a rounding issue inside of .Net. I am rounding a 3 digit
I have been successful at rounding my value to one decimal point, but I
I seem to be having an issue with PHP rounding (sort of) numbers by
Possible Duplicate: Floating point inaccuracy examples PHP rounding issue - Is this a bug?
I knew javascript could have rounding issue with divisions, but not with multiplication. How
I'm running into an issue with python automatically rounding very small numbers (smaller than
I'm facing a problem to get the digit of a number after decimal point.
I'm wondering if I found an issue with the rounding in PHP, specifically 5.2.3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.