Adding a comma to a large number variable

Greetings all,

I'll explain what I'm doing first, then explain the challenge. BTW, I'm using Storyline 360.

Using sliders, I need to move between to very large dollar values. Dollar sign aside, the range is 2,000 to 20,000 with a step of 100. However the 20,000 exceeds the limits of sliders.  I simply set my slide range 2 to 200 with a step of 1 and then in the text box that displays the slider value, I show the $, the slider variable, then add 00. So, a slider variable value of 160 ends up showing in the text box as $16000. Which is what I need. Easy Peazy.

Now the challenge, how do I add a comma at the thousand dollar point, so $16000 looks like $16,000?  Remember, there will be smaller values, so values like $4100 should look like $4,100.  I looked closely at the Adjust Variable interaction, but that is limited to simple math function +, -, * and /.  If it had an integer command to change a value of 4.1 to 4 then it would be a cake walk. I suspect there is a JavaScript solution, but Java is a foreign language to me.

Any help would be greatly appreciated. 

Thanks and happy Spring!!

Be the first to reply