M
M
McMike2016-11-30 12:34:56
PostgreSQL
McMike, 2016-11-30 12:34:56

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

1 answer(s)
M
Melkij, 2016-11-30
@melkij

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 question

Ask a Question

731 491 924 answers to any question