Skip Navigation

[Resolved] Display numeric value as currency stop working after update

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 1 voice.

Last updated by davidZ-4 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#857485
shortcode stop working.JPG

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

#857764

Hi,
i was able to solve this.
so you can close this ticket.

Thanks,

David