Skip to main content
tardigrade01
Inspiring
August 17, 2016
Question

Alternative to toLocaleString() in ExtendScript?

  • August 17, 2016
  • 1 reply
  • 781 views

As far as I can tell and after many attempts, this method doesn't work in ES. Does anyone know of an alternative for automatically adding commas to large numbers?

This topic has been closed for replies.

1 reply

tardigrade01
Inspiring
August 17, 2016

for what it's worth, this is my current, hacky workaround:

var data = {

  number: 12345

}

num = data.number.toString();

if (num.length > 3){

  data.number = num.substring(0, num.length-3) + "," + num.substring(num.length-3);

}