This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
uphp:functions:number_format [2017/05/11 08:55] admin created |
uphp:functions:number_format [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
< | < | ||
- | < | + | < |
====Description==== | ====Description==== | ||
Line 11: | Line 11: | ||
<span style=" | <span style=" | ||
<span style=" | <span style=" | ||
- | <span style=" | + | <span style=" |
<span style=" | <span style=" | ||
- | <span style=" | + | <span style=" |
)</ | )</ | ||
</ | </ | ||
- | |||
- | Return the < | ||
====Parameters==== | ====Parameters==== | ||
- | < | + | < |
- | < | + | |
+ | < | ||
- | ====Return | + | ====Return |
- | < | + | < |
====Example==== | ====Example==== | ||
- | ===Convert the float 1.55 into an string with a precision of 1 decimal point | + | ===Convert the float 1.55 into an string with a precision of 1 decimal point=== |
<code php> | <code php> | ||
Line 36: | Line 35: | ||
$f=1.55; | $f=1.55; | ||
$i=number_format($f, | $i=number_format($f, | ||
- | print(" | + | print(" |
?> | ?> | ||
</ | </ | ||
Line 42: | Line 41: | ||
The above example will output: | The above example will output: | ||
< | < | ||
- | The integer | + | The value of 1.550000 is 1.5 |
</ | </ | ||