Hi friends,
What is the easiest way to cut meter for this result :
27000 -> 27 000
1234567 -> 1 234 567
Thank you for your help
It is currently March 29th, 2024, 12:26 pm
How to cut numbers ?
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to cut numbers ?
What that meter shows up? Because you have to pass the value through a measure (for example through a Calc measure), where you have to add a Substitute option, like the following:
Code: Select all
[MeasureValue]
...
RegExpSubstitute=1
Substitute="^(\d{1,3})(\d{3})$":"\1 \2","^(\d{1,3})(\d{3})(\d{3})$":"\1 \2 \3","^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1 \2 \3 \4","^(\d{1,3})(\d{3})(\d{3})(\d{3})(\d{3})$":"\1 \2 \3 \4 \5"
If what the String meter has to show is a variable, then you have to add a (for example) a Calc measure ([MeasureValue]) and add the above RegExpSubstitute and Substitute options to that one.
If you can't handle this, please post the code you have so far.
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
Re: How to cut numbers ?
Works great with measure of course !
Thanks a lot balala for very quick & very useful regexp
Thanks a lot balala for very quick & very useful regexp
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to cut numbers ?
The only thing you have to take care, is the limit, until the substitution works well: in this case this value is 999,999,999,999,999 (15 digits). On higher values the substitution wont work. But I thing it doesn't even has to. Am I right?
-
- Posts: 71
- Joined: December 11th, 2018, 5:56 pm
- Location: France
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania