E
E
entermix2015-11-13 01:10:27
PHP
entermix, 2015-11-13 01:10:27

How to convert a number to double?

Let's say there are numbers: 0, 1, 1.5
Need to get 0.00, 1.00, 1.50
Is it possible to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2015-11-13
@entermix

echo number_format($number, 2, '.', '');
php.net/manual/en/function.number-format.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question