User Tools

Site Tools


uphp:functions:floatval

Differences

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

Link to this comparison view

uphp:functions:floatval [2017/04/06 12:31]
jeff
uphp:functions:floatval [2021/09/13 05:57]
Line 1: Line 1:
-======floatval====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Return the <html><b><span style="color:green">float<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> 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%;color:green">float 
-<span style="color:black"> 
-</html> 
-[[floatval]] ( 
-<html><span style="color:green">mixed 
-<span style="color:blue">$value 
-<span style="color:black">) 
-</html> 
-</well> 
- 
-Return the floating point equivalent 
- 
-====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>) 
- 
-====Return Value==== 
- 
-Floating point value, or: 
-  * 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) 
-  * 0 on empty <html><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> 
- 
-====Example==== 
- 
-**Convert the integer '1' into a float variable which has a value of 1.000000:** 
- 
-<code php> 
-<? 
-  $x=1; 
-  $f=floatval($x); 
-  print("The float value of ".$x." is ".$f); 
-?> 
-</code> 
- 
-The above example will output: 
-<code> 
-The float value of 1 is 1.000000 
-</code> 
- 
-====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> 
- 
-[[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> 
- 
-[[is_numeric()]] - Check if a value is numeric (<html><b><span style="color:green">int<span style="color:black"></b></html>, <html><b><span style="color:green">float<span style="color:black"></b></html> or numeric <html><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()]] - Take an IEEE-754 encoded <html><b><span style="color:green">integer<span style="color:black"></b></html> (32 bit) and return a <html><b><span style="color:green">float<span style="color:black"></b></html> 
- 
-[[uphp:variables|uPHP Variable Types and Limits]] 
  
uphp/functions/floatval.txt · Last modified: 2021/09/13 05:57 (external edit)