Adding Currency - One Last Try

Hey everyone…

Not sure why this is so hard but can someone look at this file and let me know where my logic is wrong. I am honestly just trying to add two values (2000 + 2000 = 4000) and have the display be ($2,000) ($2,000) ($4,000) when done with the input. Any help is greatly appreciated

addingCurrency.rp (47.5 KB)

Anyone here? If so thanks for the help

Still here! Dealing with math in text fields can be a headache because of the way Axure handles global variables.

Axure is notoriously picky about non-numeric characters in math! The trick is usually to keep your ‘math’ column purely as numbers in a hidden variable or column, and only add the ‘$’ and commas in the ‘Set Text’ action. Once those characters are in the field, Axure stops treating it like a number and starts treating it like a string.

This helped me a lot. Thanks! :smiley:

Axure often struggles when math involves symbols. A good way to handle this is to use local variables to store the raw numbers and then apply the string formatting using .toLocaleString() or manual character placement only at the very end of the interaction.

addingCurrency@Jorkin.rp (50.4 KB)

You need to handle both “$” and “,” as temporary variables before performing the addition.

Preview: https://rvctd0.axshare.com/

It sounds like you're running into a common data type issue. Make sure your variables are specifically set to numeric values before the calculation, otherwise Axure might treat them as strings and just concatenate the numbers instead of performing the addition.