This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:floatval [2017/03/10 09:53] jeff |
uphp:functions:floatval [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======floatval====== | ======floatval====== | ||
+ | |||
< | < | ||
- | Return the floating point value of a number or string | + | < |
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
+ | <span style=" | ||
</ | </ | ||
Return the floating point equivalent | Return the floating point equivalent | ||
- | ====Parameters==== | + | ====Parameter==== |
- | < | + | |
- | ====Return | + | < |
- | Floating point value, or: | + | |
- | * 0 on failure (for example, | + | ====Return |
- | * 0 on empty arrays | + | |
- | * 1 on non-empty | + | * < |
+ | * < | ||
+ | * < | ||
+ | * < | ||
====Example==== | ====Example==== | ||
- | Convert the integer ' | + | |
+ | ===Convert the integer ' | ||
<code php> | <code php> | ||
<? | <? | ||
- | $i=1; | + | |
- | $f=floatval($i); | + | $f=floatval($x); |
- | print(" | + | print(" |
?> | ?> | ||
</ | </ | ||
+ | |||
The above example will output: | The above example will output: | ||
< | < | ||
Line 38: | Line 45: | ||
====See Also==== | ====See Also==== | ||
- | [[intval()]] - Return the integer value of a number or string | ||
- | [[is_numeric()]] - Return | + | [[intval()]] - < |
+ | |||
+ | [[strval()]] - < | ||
+ | |||
+ | [[is_numeric()]] - < | ||
+ | |||
+ | [[inttoieee754()]] - < | ||
- | [[ieee754toint()]] - Take a floating point value and return an IEEE-754 encoded integer (32 bit) | + | [[uphp: |
- | [[inttoieee754()]] - Take an IEEE-754 encoded integer (32 bit) and return a float |