Мне нужна помощь. На веб-сайте недвижимости Wordpress я хотел бы отобразить цену в XPF рядом с ценой в €.Ценообразование
Функция цена:
public static function format_price($price,$html = true){
$return = '';
$currency_code = self::get_general_option('currency');
$currency_symbol = self::get_currency_symbol($currency_code);
$currency_position = self::get_general_option('currency_position');
switch ($currency_position) {
case 'left' :
$format = '%1$s%2$s';
break;
case 'right' :
$format = '%2$s%1$s';
break;
case 'left_space' :
$format = '%1$s %2$s';
break;
case 'right_space' :
$format = '%2$s %1$s';
break;
default:
$format = '%1$s%2$s';
}
$thousands_sep = wp_specialchars_decode(stripslashes(self::get_general_option('price_thousand_sep')),ENT_QUOTES);
$decimal_sep = wp_specialchars_decode(stripslashes(self::get_general_option('price_decimal_sep')),ENT_QUOTES);
$num_decimals = self::get_general_option('price_num_decimals');
$price = floatval($price);
if(!$html) {
return self::number_format($price, $num_decimals, '.', '', $currency_code);
}
$price = self::number_format($price, $num_decimals, $decimal_sep, $thousands_sep, $currency_code);
if('text' === $html) {
return sprintf($format, $currency_symbol, $price);
}
//$price = preg_replace('/' . preg_quote(self::get_general_option('price_decimal_sep'), '/') . '0++$/', '', $price);
$return = '<span class="amount">' . sprintf($format, $currency_symbol, $price) . '</span>';
return $return;
}
Скорость преобразования: 1 € = 119.33XPF
Как я могу изменить код, чтобы отобразить цену, как это, например: 11933000XPF (100000 €)
Спасибо.
Большое спасибо! Это сработало. – user3301061