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 8832755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:36:26+00:00 2026-06-14T08:36:26+00:00

I have a lot of data which i retrieve from the database and create

  • 0

I have a lot of data which i retrieve from the database and create a chart using those data (some of them are added)

One of the charts is displaying percentage and therefore i have to calculate my data to percent.

My boss has another program that also displays the percentage (but has no graph) and after making my program he came to me and said that the numbers in my table are wrong.

I looked it over my and found that the double (that is calculated into percentage) was the following number: 85.53178390026166

Apparently my program rounded this number up to 86.

Now my question is: Is there any way I can stop the program rounding doubles up unless it is .75 or closer? and instead in this example round-down to 85?

  • 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-06-14T08:36:27+00:00Added an answer on June 14, 2026 at 8:36 am

    Well first of all notice that 85.53 is CLOSER to 86 than it is to 85. That being said, if you want it to only round up if it’s .75 or greater, do:

    Math.floor(number + .25);
    

    Example:

    10.2 -> 10.45 -> 10
    10.6 -> 10.85 -> 10
    10.74 -> 10.99 -> 10
    10.76 -> 11.01 -> 11
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to develop a layer to retrieve data from a database (can be
I am creating Excel file download using NOPI libraries. I have lot of data
I have a lot of data-entryists using my ASP.NET application and we have all
We have a large database with a lot of data in it. I found
I have a process that imports a lot of data (950k rows) using inserts
I'm currently dumping a lot of information from a PDB file I retrieve using
I have a UIScrollView which scrolls horizontally, I have lot of data to be
I have a json hash which has a lot of keys. I retrieve this
I have a lot of text data and want to translate it to different
I am trying to build a data mart. I have lot of dimensions, and

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.