تابع ووکامرسی wc_float_to_string تبدیل عدد اعشاری به رشته بدون در نظر گرفتن فرمت بومی

تابع ووکامرسی wc_float_to_string – تبدیل عدد اعشاری به رشته بدون در نظر گرفتن فرمت بومی
Syntax – سینتکس
(string) wc_float_to_string( (float) $float );
Parameters – پارامتر ها (1)
- 1- $float (float)
Usage – نحوه استفاده
if ( !function_exists( 'wc_float_to_string' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php';
}
// The float.
$float = null;
// NOTICE! Understand what this does before running.
$result = wc_float_to_string($float);
Defined – محل تعریف
/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;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر