Page 1 of 1

How to add thousand separator using regex?

Posted: 07 Jun 2019 05:50
by gilanxcheetz
anyone can help me, how to add a thousand separator with comma?
from 1234567 to 1,234,567

Re: How to add thousand separator using regex?

Posted: 07 Jun 2019 15:47
by Desmanto
You don't need regex, a simple numberformat is enough.

Code: Select all

num = 1234567;
show = "{num,numberformat,#,###}";
For more about numberformat pattern, visit the documentation : https://automagic4android.com/automagic ... terns.html
Or you can find the numberformat help in the script help menu.

Re: How to add thousand separator using regex?

Posted: 07 Jun 2019 16:14
by gilanxcheetz
Desmanto wrote:
07 Jun 2019 15:47
You don't need regex, a simple numberformat is enough.

Code: Select all

num = 1234567;
show = "{num,numberformat,#,###}";
For more about numberformat pattern, visit the documentation : https://automagic4android.com/automagic ... terns.html
Or you can find the numberformat help in the script help menu.
working perfectly, terima kasih :mrgreen: