Answer the question
In order to leave comments, you need to log in
How to round a number to significant digits?
How to round a number to significant digits?
I don’t quite understand why, but numbers are stored in the database (type double)
And PHP (MySQL?) Extracts some (not all) incorrectly
For example, there is a number in the database - 69.6
It is extracted as 69.59999999999999
Or the number 8.3
is Extracted as 8.30000000001
Where do these insignificant numbers?
Is it some kind of setting in PHP or MySQL?
How can you normalize numbers?
Answer the question
In order to leave comments, you need to log in
SQL floating point comparison issues
SELECT ROUND(8.30000000001,2);
-- 8.30
$a = round(8.30000000001,2);
// 8.30
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question