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

  • Home
  • SEARCH
  • 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 3315262
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:19:46+00:00 2026-05-17T22:19:46+00:00

Look at this query please SELECT max( val_amd ) FROM `best_deposits` I have the

  • 0

Look at this query please

SELECT max( val_amd ) FROM `best_deposits` 

I have the max value in the table equal to 14.6(the fields has type float),

But it returns 14.3599996566772

why does it happen, and how can i get the exact value?

Thanks much

  • 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-17T22:19:46+00:00Added an answer on May 17, 2026 at 10:19 pm

    floats are evil!

    NEVER use floats for storing amounts or prices. instead of that, use an int and store the amount in cents. thats the only way to get around those problems forever.

    why this happens: because floats can’t be saved exactly in many cases (such as 0.6 in your case)

    PS: we had those questions a hundret times for different languages till now:

    • Use Float or Decimal for Accounting Application Dollar Amount?
    • PHP rounding problem (5.2.3)?
    • Rounding problem with double type
    • Javascript rounding v c# rounding
    • Python rounding problem
    • … and a lot more

    EDIT: to your comment: as i said:

    use an int and store the amount in
    cents

    (alternatively you could use an DECIMAL(10,2) (or how big/how much decimal places you need)… not sure about how this works)

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

Sidebar

Related Questions

this query give me 'Incorrect syntax near the keyword 'select'.' look please below bold
I'm using SQL Server 2005. The query would look like this Select col1, col2,
Please have a look at the below SQL code. DECLARE @RET TABLE(OID BIGINT NOT
if i use this query thath creates a table(look Table1), But VisitingGap column is
look at this table please table |id| |name| |order| i must get the rows,
i have a table (tbl_world) which look like this id | first_name | last_name
i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT
I have this query that is optimized for speed (that's why it might look
I'm trying to turn this query into a view: SELECT t.* FROM user t
Please can you take a look at this query and point out what I'm

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.