Saving float number to MariaDB get strange rounded number

HI all,

I have a model value that is caculated as: 36,758,816

However, whenever I save that number to MariaDB , it get rounded to: 36,758,800

I have checked and there is no other place in my code manipulate that number. The number is stored in Float column

What is wrong with PHP ? or MariaDB ?

You need to be more specific
What exactly is the DB structure?
What Cake version? What PHP version?
What is the number exactly looking like in PHP? Is is a string, is it float? For both, the current number as you wrote it is invalid, as it would not contain those commas.
So you need to be much more precise if you want some valuable feedback from someone.

Thank you dereuromark

CakePHP version: 4.2.8

PHP Version: 7.4.33

MariaDB version: 10.11.13 on Ubuntu

In CakePHP, the number is float as it is calculated by round($val, 0, PHP_ROUND_HALF_UP) , and the database structure of the column is float.

All the numbers in Cake, PHP, and Databast are to be sure float, I just write them out with comma for you all to read easily.

If I change all of them to Int (cast Int in CakePHP after round(), and change column type in MariaDB to Int), it will just works fine. But I want them to be Float

DB “float” doesnt exist on its own.
you need to let us know the exist definition of it, including precision.
So best to export SQL and copy and paste that.

I just write them out with comma for you all to read easily.

Also always copy and paste exact values, do not make things up.