User Tools

Site Tools


uphp:functions:floatval

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:floatval [2017/03/18 19:25]
jeff
uphp:functions:floatval [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======floatval====== ======floatval======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return the floating point value of a number or string+<html>Return the <b><span style="color:green">float<span style="color:black"></b> value of a <b><span style="color:green">number<span style="color:black"></b> or <b><span style="color:green">string<span style="color:black"></b></html>
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">float + 
-<span style="color:black;"></html>[[floatval]] ( +<well size="sm"><html> 
-<html><span style="color:green;">mixed +<span style="font-size:125%;color:green">mixed 
-<span style="color:blue;">$value +<span style="color:black">floatval (<span style="color:green">mixed 
-<span style="color:black;">)+<span style="color:blue">$value 
 +<span style="color:black">)
 </html></well> </html></well>
  
 Return the floating point equivalent Return the floating point equivalent
  
-====Parameters==== +====Parameter====
-<html><span style="color:blue;"><b>value</b><span style="color:black;"></html>:  A string with a leading number, or a number (int or float)+
  
-====Return Value==== +<html><b><span style="color:blue">$value<span style="color:black"></b>:  A <b><span style="color:green">string<span style="color:black"></b> with a leading number, or a <b><span style="color:green">number<span style="color:black"></b> (<b><span style="color:green">int<span style="color:black"></b> or <b><span style="color:green">float<span style="color:black"></b>)</html> 
-Floating point value, or+ 
-  * 0 on failure (for example, strings without a numeric in the leftmost characters) +====Return Values==== 
-  * 0 on empty arrays + 
-  * 1 on non-empty arrays+  * <html><b><span style="color:green">Float<span style="color:black"></b></html> (if an equivalent exists) 
 +  * <html><b><span style="color:green">Int<span style="color:black"></b> 0 on failure (for example, a <b><span style="color:green">string<span style="color:black"></b> without a numeric in the leftmost characters)</html> 
 +  * <html><b><span style="color:green">Int<span style="color:black"></b> 0 on empty <b><span style="color:green">array<span style="color:black"></b></html> 
 +  * <html><b><span style="color:green">Int<span style="color:black"></b> 1 on non-empty <b><span style="color:green">array<span style="color:black"></b></html>
  
 ====Example==== ====Example====
-**Convert the integer '1' into a float variable which has a value of 1.000000:**+ 
 +===Convert the integer '1' into a float variable which has a value of 1.000000===
  
 <code php> <code php>
Line 40: Line 45:
  
 ====See Also==== ====See Also====
-[[intval()]] - Return the integer value of a number or string 
  
-[[is_numeric()]] - Return 1 if the value is numeric (integer, float or numeric string)+[[intval()]] - <html>Return the <b><span style="color:green">integer<span style="color:black"></b> value of a <b><span style="color:green">number<span style="color:black"></b> or <b><span style="color:green">string<span style="color:black"></b></html> 
 + 
 +[[strval()]] - <html>Return the <b><span style="color:green">string<span style="color:black"></b> equivalent of a <b><span style="color:green">number<span style="color:black"></b></html> 
 + 
 +[[is_numeric()]] - <html>Check if a value is numeric (<b><span style="color:green">int<span style="color:black"></b><b><span style="color:green">float<span style="color:black"></b> or numeric <b><span style="color:green">string<span style="color:black"></b>)</html>
  
-[[ieee754toint()]] - Take a floating point value and return an IEEE-754 encoded integer (32 bit)+[[inttoieee754()]] - <html>Convert an IEEE-754 encoded <b><span style="color:green">integer<span style="color:black"></b> representation (32 bit) to a <b><span style="color:green">float<span style="color:black"></b></html>
  
-[[inttoieee754()]] - Take an IEEE-754 encoded integer (32 bit) and return a float+[[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/floatval.1489865134.txt.gz · Last modified: 2021/09/13 05:56 (external edit)