0
私はいくつかの助けが必要です。 Wordpressの不動産ウェブサイトでは、値段の横に価格を€で表示したいと考えています。価格変換
価格関数は次のとおりです。
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