I tried using toLocaleString() but it doesn't seem to work. I then tried using a regex but couldn't make it work either. I then thought about adding commas to every third digit using for loop before I stopped myself and reached out for help.
Solved! Go to Solution.
There are a couple of ways of formatting numbers
You can use a computed field like this:
You can use script a a regular expression like this
item.NICE_FIELD = uglyField.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
I tried both of these and they seem to work.
Search the Autodesk Knowledge Network for more content.
Couldn’t make it to Autodesk University? Some of the Fusion Lifecycle Classes are available to watch on-demand: