Skip Navigation

[Résolu] Display numeric value as currency stop working after update

This support ticket is created Il y a 6 années et 6 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 1 réponse, a 1 voix.

Dernière mise à jour par davidZ-4 Il y a 6 années et 6 mois.

Assisté par: Shane.

Auteur
Publications
#857485
shortcode stop working.JPG

I am trying to: Display numeric value as currency

Link to a page where the issue can be seen: lien caché

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