wc_float_to_string() WC 1.0
Convert a float to a string without locale formatting which PHP adds when changing floats to strings.
Хуков нет.
Возвращает
Строку.
Использование
wc_float_to_string( $float );
- $float(float) (обязательный)
- Float value to format.
Код wc_float_to_string() wc float to string WC 5.0.0
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;
}