wc_float_to_string()
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 8.7.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; }