anyone can help me, how to add a thousand separator with comma?
from 1234567 to 1,234,567
How to add thousand separator using regex?
Moderator: Martin
-
- Posts: 18
- Joined: 08 Nov 2018 15:10
- Contact:
How to add thousand separator using regex?
From: Redmi 5 Plus (Vince)
Re: How to add thousand separator using regex?
You don't need regex, a simple numberformat is enough.
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.
Code: Select all
num = 1234567;
show = "{num,numberformat,#,###}";
Or you can find the numberformat help in the script help menu.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 18
- Joined: 08 Nov 2018 15:10
- Contact:
Re: How to add thousand separator using regex?
working perfectly, terima kasihDesmanto wrote: ↑07 Jun 2019 15:47You don't need regex, a simple numberformat is enough.For more about numberformat pattern, visit the documentation : https://automagic4android.com/automagic ... terns.htmlCode: Select all
num = 1234567; show = "{num,numberformat,#,###}";
Or you can find the numberformat help in the script help menu.

From: Redmi 5 Plus (Vince)