wc_float_to_string()
Convert a float to a string without locale formatting which PHP adds when changing floats to strings.
No Hooks.
Return
String
.
Usage
wc_float_to_string( $float );
- $float(float) (required)
- Float value to format.
wc_float_to_string() wc float to string code WC 9.6.1
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; }