How to format number = "$lowprice" to currency
$price_content .= '<span>';
if ($currency_sympol) $price_content .= get_post_meta($id,$wprs_prefix.'lowprice', TRUE);
$price_content .= '<sup>'.$currency_sympol.'</sup>';
$price_content .= '</span>';
How to format number = "$lowprice" to currency
$price_content .= '<span>';
if ($currency_sympol) $price_content .= get_post_meta($id,$wprs_prefix.'lowprice', TRUE);
$price_content .= '<sup>'.$currency_sympol.'</sup>';
$price_content .= '</span>';
To format a number as currency use the money_format()
function. (Docs)
$lowprice = 1234.56;
// Italian national format with 2 decimals
setlocale(LC_MONETARY, 'it_IT');
echo money_format('%.2n', $lowprice) . "
";
// Eu 1.234,56
Since the currency is derived from the server locale, you might need to change it (see sample).