I am trying to: Display numeric value as currency
Link to a page where the issue can be seen: hidden link
I expected to see: numeric value as currency
Instead, I got: number in shortcode brackets
I have a code to display numeric value as a currency using a shortcode it was working just fine until my last update.
// Display numeric value as currency
function format_my_number($atts)
{
$atts = shortcode_atts(
array(
'num' => '',
'sym' => '',
),
$atts
);
$num = $atts['num'];
return $atts['sym'].' '.number_format($num, 0, '.', ',');
}
add_shortcode('format-currency', 'format_my_number');
For some reason it stooped working and i get this instead:
Net Worth: [format-currency num=360145 sym=’$’]
The content template display the number as currency is set like this:
[types field='cash-flow' format='FIELD_NAME'][/types]: [format-currency num=[types field='cash-flow' format='FIELD_VALUE'][/types] sym='$']
Please advise,
thanks,
David
Hi,
i was able to solve this.
so you can close this ticket.
Thanks,
David