Currency Total from Two Amount Text Fields

Not sure if there is anyone out there that can help but I think this is a simple formatting issue. Essentially I have two text inputs that are coded to display as currency ($xx,xxx) I have another input field that I want to display the total in dynamically.

My first two fields work the way I want but the sum field isn’t calculating the values.

Any help is appreciated…
amountSum.rp (48.5 KB)

You need to replace characters such as $, , +, -, . and so on.

Adding currency in Axure can be tricky because of the decimal points! Just a heads-up: make sure you use the [[ (LVAR1 + LVAR2).toFixed(2) ]] expression. The .toFixed(2) part is a lifesaver—it keeps the trailing zeros from disappearing so your total actually looks like money ($10.50 instead of $10.5).

This is a common issue when working with formatted strings in Axure. Often the calculation fails because the software is trying to add the currency symbols as part of the string. You might need to use the .replace() function to strip out the dollar sign and commas before performing the addition, then apply the formatting back to the final sum field.

That makes sense, Axure can be quite picky with string formatting. If the suggestions above don’t work, double-check that your local variables are correctly capturing only the numeric part of the input before the math is applied. Often a simple ‘Text Changed’ interaction on the source fields is enough to trigger the calculation.