
Anonymous Community User asked a question.
Trouble with the format of my calculation field output!
Hi! I'm using a calculation with a javascript format that works great EXCEPT in a few cases. It's a copy/paste job - I do not speak javascript! Here's the calc: "$ " + ((@ARV * (@Percent of ARV / 100)) - @Repair Costs) .toString().replace(/\\\\B(?=(\\\\d{3})+(?!\\\\d))/g, ","); Where the input values are: @ARV = 90,000 @Percent of ARV = 70 @Repair Costs = 25,000 The output with the above formatting is: "$ 37,999.99,999,999,999", which is, of course, a ridiculous number. If the "@ARV" value is any number OTHER than a factor/multiple of 70 (for example, "60"), I get a nice, cleanly formatted number (e.g. "$ 29,000"), which is what I want. Does anyone smarter than me at javascript have any ideas as to how can I change my script so that I can cut the number off after "$ 37,999" in the above example?