Decimal number issue in cakephp 4 (Scientific Notation)


I have “double” type in table and I am trying to save “0.000025” value, at database its showing same as.

but at Entity Object (Cakephp 4.2.0) it’s showing “2.5E-5” instead of “0.000025” and also in form input it’s showing “2.5E-5” as value.

What I am missing here ?


This is just how PHP represents small float numbers, nothing that CakePHP is doing here regarding the scientific notation.

See php - Display float value w/o scientific notation - Stack Overflow

Columns declared as double will be parsed as float. But be aware that parsing increasingly small numbers to float can lead to precission loss as you see here: PHP Sandbox - Execute PHP code online through your browser

1 Like