Forum Academy Marketplace Showcase Pricing Features

[SOLVED] Format math.js results as currency

I have a text field which displays the results of an API post to math.js . I would like the result to always be formatted as currency … with the $ and the two decimal places.

I have the following calculation set up;
{
“expr”: [
“5 + 5”
],
“precision”: 14
}

So the result is 10, but I want it formatted as $10.00 . Any ideas as to how this can work?

You can use the “formatted as” option in the text element following your math.js value :slight_smile:

1 Like

Hmm, I don’t seem to have the option for currency.

The text’s input is already used to call the external API; “math.js - Price Calculator’s result”

So I clicked on (more) and selected “formatted as…” but my only options are US Phone and URL Encoded. Any idea what am I messing up?

Ah, I see what I did wrong. The call type of the API connector i have set up to post to math.js was set to text. Modifying its call type to number fixed it.

Thanks for your help!

1 Like

No problem :slight_smile: I’ve done the same!