wc_float_to_string( float $float )
Convert a float to a string without locale formatting which PHP adds when changing floats to strings.
Description Description
Parameters Parameters
- $float
-
(Required) Float value to format.
Return Return
(string)
Source Source
File: includes/wc-formatting-functions.php
function wc_float_to_string( $float ) { if ( ! is_float( $float ) ) { return $float; } $locale = localeconv(); $string = strval( $float ); $string = str_replace( $locale['decimal_point'], '.', $string ); return $string; }