Hi all,
sorry for this question, but i did not find anything related...
I have a variable / String which is formated like this: 10000.00
How do i do a number format to convert it into european currency format like this 10.000,00 ?
Many thanks for your help and all the best,
Lars
It is currently April 27th, 2024, 1:09 pm
Number Format Question
-
- Posts: 5
- Joined: January 6th, 2024, 2:56 pm
-
- Posts: 50
- Joined: December 5th, 2022, 3:45 am
- Location: Madrid, Spain
Re: Number Format Question
Sorry but I'm very new, have you tried adding this line below the result?
That's all I can think of
Code: Select all
Substitute="0000.00":"0.000,00"
-
- Posts: 5
- Joined: January 6th, 2024, 2:56 pm
Re: Number Format Question
Thanks for your answer, but it's not working
Maybe another idea?
Thanks and all the best
Maybe another idea?
Thanks and all the best
-
- Posts: 50
- Joined: December 5th, 2022, 3:45 am
- Location: Madrid, Spain
Re: Number Format Question
Wait for a guru, there are many here and surely someone is already studying the best answer.
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Number Format Question
CarlotaN was close earlier, you'd typically do it in a Substitute option, though it's a bit more complex than the previous advice. It can be done using Lua too, with the approach similarly "special". I wrote solutions for both approaches and could post them when I'm back to my laptop, but if you don't want to wait, you can check this thread, since my variants are more or less along the same lines:Lars wrote: ↑February 25th, 2024, 9:21 am Hi all,
sorry for this question, but i did not find anything related...
I have a variable / String which is formated like this: 10000.00
How do i do a number format to convert it into european currency format like this 10.000,00 ?
Many thanks for your help and all the best,
Lars
https://forum.rainmeter.net/viewtopic.php?t=17379
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Number Format Question
As promised, here's the Substitute way (it involves regular expressions):
Code: Select all
[Variables]
Value=10000.00
ThousandsSeparator="."
DecimalsSeparator=","
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,255
---Measures---
[Text]
Measure=String
String=#Value#
RegExpSubstitute=1
Substitute="(?<=\d)\.":"#DecimalsSeparator#","^([\-\+]?\d+)$":"\1#DecimalsSeparator#","(\d)(?=(?:\d{3})+\#DecimalsSeparator#)":"\1#ThousandsSeparator#","\#DecimalsSeparator#$":""
---Meters---
[Result]
Meter=String
FontFace=Consolas
FontSize=16
FontColor=255,255,255,255
AntiAlias=1
MeasureName=Text
Text=Result = %1
DynamicVariables=1
-
- Posts: 5
- Joined: January 6th, 2024, 2:56 pm
Re: Number Format Question
Thank you
That's exactly what i am looking for...
Many thanks
That's exactly what i am looking for...
Many thanks
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita