Php takes a decimal place and waits for $ str = 35.5454 online. how can we get 35.5?, PHPcode $ result = round (35.5454, 1);, $ str = 35.5454; $ str = number_format ($ str, 1); & nbsp; echo $ php takes a decimal point, online, etc.
$ Str = 35.5454;
Select 35.5.
How to implement it,
------ Solution --------------------
PHP code
$ Result = round (35.5454, 1 );
------ Solution --------------------
$ Str = 35.5454;
$ Str = number_format ($ str, 1 );
Echo $ str;
------ Solution --------------------
Discussion
$ Str = 35.5454;
$ Str = number_format ($ str, 1 );
Echo $ str;
------ Solution --------------------
PHP code
$ Str = 35.5454; $ num = number_format ($ str, 1)
------ Solution --------------------
$ Xxx = sprintf ('%. 1f', $ xxx );
------ Solution --------------------
$ Result = round (35.5454, 1 );
------ Solution --------------------
Close the post to score.
Is it online ????
------ Solution --------------------
Sprintf ('% 0.1f', $ str );
------ Solution --------------------
Float!
------ Solution --------------------
Round (35.5454, 1 );
------ Solution --------------------
Round (3.14159, 1 );
Number_format (3.14159265, 1, '.', ''); // The result is better. if the ending number is 0, the value of 0 is automatically added.
------ Solution --------------------
Discussion
Round (3.14159, 1 );
Number_format (3.14159265, 1, '.', ''); // The result is better. if the ending number is 0, the value of 0 is automatically added.