Variable to Dollars and cents, thousands comma if needed

I’ll probably kick myself when I get the answer.
I have a variable which is intended to be dollars and cents, (always different numbers)
sometimes 3 digits ie. 357
sometimes 4 digits ie. 963.4
sometimes 5 digits ie. 963.48
sometimes 6 digits ie. 1357.00
Is there a way to ‘filter’ the variable and if it has no ‘cents’ i.e. 357, it would add .00 = 357.00
OR, if it was 1958.52 it could filter to make 1,958.52 (adding the thousands ‘comma’)
All of this of course with or without a dollar sign if possible.

Hey Troy,

This is simple once you know the trick, but it's a somewhat hidden feature.

Look in the settings menu (right-upper-corner) of the Calculation action — note the “Format Result” menu item.

-Chris


Format a Number Using a Calculation.kmmacros (2.7 KB)

1 Like

@troy, Chris is correct, but the last action needs a minor adjustment to put commas in the number:
Format: #,000.00

1 Like

Chris and JMichael, thank you to you 2 especially, always being so helpful on the forum. The way you present your answers to questions, is always so positive and encouraging. You make this forum very enjoyable and so informative. Most importantly, not intimidating.

  • the best.
    Oh, and thanx for the answer to the formatting issue =)