Sanitize to floating point value
Values for getString
argument:
false
(bool): do not return string value (default). 3.0.171+true
(bool): locale aware floating point number string. 3.0.171+f
(string): locale aware floating point number string (same as true). 3.0.193+F
(string): non-locale aware floating point number string. 3.0.193+e
(string): lowercase scientific notation (e.g. 1.2e+2). 3.0.193+E
(string): uppercase scientific notation (e.g. 1.2E+2). 3.0.193+
Usage
// basic usage
$float = $sanitizer->float($value);
// usage with all arguments
$float = $sanitizer->float($value, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
value | float, string, int | |
options (optional) | array | Optionally specify one or more options in an associative array:
|
Return value
float
string
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.236