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/04/04 13:18]
jeff
uphp:functions:floatval [2021/09/13 05:57] (current)
Line 3: Line 3:
 <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 <html><b><span style="color:green">number<span style="color:black"></b></htmlor <html><b><span style="color:green">string<span style="color:black"></b></html>+<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 +<well size="sm"><html> 
-<span style="color:black"></html>[[floatval]] ( +<span style="font-size:125%;color:green">mixed 
-<html><span style="color:green">mixed+<span style="color:black">floatval (<span style="color:green">mixed
 <span style="color:blue">$value <span style="color:blue">$value
 <span style="color:black">) <span style="color:black">)
Line 18: Line 18:
 ====Parameter==== ====Parameter====
  
-<html><b><span style="color:blue">$value<span style="color:black"></b></html>:  A <html><b><span style="color:green">string<span style="color:black"></b></html> with a leading number, or a <html><b><span style="color:green">number<span style="color:black"></b></html> (<html><b><span style="color:green">int<span style="color:black"></b></html> or <html><b><span style="color:green">float<span style="color:black"></b></html>)+<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>
  
-====Return Value====+====Return Values====
  
-Floating point value, or+  * <html><b><span style="color:green">Float<span style="color:black"></b></html> (if an equivalent exists) 
-  * 0 on failure (for example, a <html><b><span style="color:green">string<span style="color:black"></b></html> without a numeric in the leftmost characters) +  * <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> 
-  * 0 on empty <html><b><span style="color:green">array<span style="color:black"></b></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> 
-  * 1 on non-empty <html><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 46: Line 46:
 ====See Also==== ====See Also====
  
-[[intval()]] - Return the <html><b><span style="color:green">integer<span style="color:black"></b></html> value of a <html><b><span style="color:green">number<span style="color:black"></b></html> or <html><b><span style="color:green">string<span style="color:black"></b></html>+[[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()]] - Return the <html><b><span style="color:green">string<span style="color:black"></b></html> equivalent of a <html><b><span style="color:green">number<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()]] - Return 1 if the value is numeric (<html><b><span style="color:green">int<span style="color:black"></b></html>float or numeric <html><b><span style="color:green">string<span style="color:black"></b></html>)+[[is_numeric()]] - <html>Check if 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 <html><b><span style="color:green">integer<span style="color:black"></b></html> (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 <html><b><span style="color:green">integer<span style="color:black"></b></html> (32 bit) and return <html><b><span style="color:green">float<span style="color:black"></b></html>+
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/floatval.1491311922.txt.gz · Last modified: 2021/09/13 05:56 (external edit)