Answer the question
In order to leave comments, you need to log in
How to convert 1e-06 to 0.000001 in Yii model?
When writing to the table (double field) of the value 0.000001, the value 1e-06 appears in the field.
Reading into the model gives 1e-06, not 0.000001.
How to proceed in this case? It is necessary that in the model it turns out 0.000001
Answer the question
In order to leave comments, you need to log in
The numbers are identical. Well, as far as it's possible for by design to approximate double.
If you need to show the user in decimal format, then pay attention to the word "show". So this is a question for the view, not the model. Regular number_format, for example, can be used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question