It is currently March 28th, 2024, 3:27 pm

hard disk size

Get help with creating, editing & fixing problems with skins
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: January 3rd, 2019, 9:09 pm Ok, doesn't matter. Just post them anytime you have any.
Hey. help. tell me how to make a mask for the withdrawal of numbers of the type "0.000,000" it for a more accurate value of the free disk.
the first digit is a terabyte then "point", three digits are gigabytes then" comma", the last three digits are megabytes.

Image

I slightly slightly changed your code

Code: Select all

[Rainmeter]
Update=1000

[Variables]
@Include="..\UserVariables.inc"

[MeasureFreeDrive2]
Measure=FreeDiskSpace
Drive=#Drive2#
UpdateDivider=2

[MeasureFreeDrive2Scaled]
Measure=Calc
Formula=(( MeasureFreeDrive2 > ( 1024 ** 2 )) ? ( MeasureFreeDrive2 / ( 1024 ** 2 )) : (( MeasureFreeDrive2 > 1024 ) ? ( MeasureFreeDrive2 / 1024 ): MeasureFreeDrive2 ))

[MeasureFreeDrive2Unit]
Measure=Calc
Formula=((( MeasureFreeDrive2 > ( 1024 ** 2 )) ? 2 : (( MeasureFreeDrive2 > 1024 ) ? 1 : 0 )))
Substitute="0":"","1":" k","2":" M","3":" GB"

[MeterDrive]
Meter=STRING
MeasureName=MeasureFreeDrive2Scaled
MeasureName2=MeasureFreeDrive2Unit
NumOfDecimals=
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=14
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#Drive2# storage space:#CRLF#%1%2
I think that the last three digits of " megabytes "can be written through" NumOfDecimals=3 " if not then write as you think is correct.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

Post by balala »

xsander_7 wrote: January 5th, 2019, 10:15 pm I think that the last three digits of " megabytes "can be written through" NumOfDecimals=3 " if not then write as you think is correct.
Yep, it can be, but the issue is that since in English the decimal separator is not the comma, but the point, if the number is written with three decimals, you'll get there a point, not a comma.
So, first let's add the point(s). For this you have to add the following two options to the [MeasureFreeDrive2Scaled] measure (don't modify any of the existing options, just add these two new ones):

Code: Select all

[MeasureFreeDrive2Scaled]
...
RegExpSubstitute=1
Substitute="^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1.\2.\3.\4","^(\d{1,3})(\d{3})(\d{3})$":"\1.\2.\3","^(\d{1,3})(\d{3})$":"\1.\2"
Check please this solution and tell me how does it look.
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: January 5th, 2019, 10:35 pm
Check please this solution and tell me how does it look.
Thanks so much, this is amazing.
Image
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

Post by balala »

xsander_7 wrote: January 5th, 2019, 10:40 pm Thanks so much, this is amazing.
Do you like this solution, is it OK?
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: January 5th, 2019, 11:03 pm Do you like this solution, is it OK?
Yes, there are separators.
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: January 5th, 2019, 11:03 pm Do you like this solution, is it OK?
good evening. can you make the correct display of the free space size?
here is the code

Code: Select all

[Rainmeter]
Update=1000


[MeasureFreeDrive2]
Measure=FreeDiskSpace
Drive=D:
UpdateDivider=2

[MeasureFreeDrive2Scaled]
Measure=Calc
Formula=(( MeasureFreeDrive2 > ( 1024 ** 2 )) ? ( MeasureFreeDrive2 / ( 1024 ** 2 )) : (( MeasureFreeDrive2 > 1024 ) ? ( MeasureFreeDrive2 / 1024 ): MeasureFreeDrive2 ))
RegExpSubstitute=1
Substitute="^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1.\2.\3.\4","^(\d{1,3})(\d{3})(\d{3})$":"\1.\2.\3","^(\d{1,3})(\d{3})$":"\1.\2"
[MeasureFreeDrive2Unit]
Measure=Calc
Formula=((( MeasureFreeDrive2 > ( 1024 ** 2 )) ? 2 : (( MeasureFreeDrive2 > 1024 ) ? 1 : 0 )))
Substitute="0":"","1":" k","2":" M","3":" GB"

[MeterDrive]
Meter=STRING
MeasureName=MeasureFreeDrive2Scaled
MeasureName2=MeasureFreeDrive2Unit
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=14
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=D: storage space:#CRLF#%1%2
;AutoScale=1
;NumOfDecimals=6
it shows that 1.196.850 is free

but if you apply not the formula but
AutoScale=1
NumOfDecimals=6
it shows 1.141404 and this is the correct value of free disk space, but then how to put "." what would be 1.141.404
https://i.ibb.co/mvZf9Mt/5cfa4412bee6.png
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

Post by balala »

xsander_7 wrote: August 27th, 2022, 2:22 pm but if you apply not the formula but
AutoScale=1
NumOfDecimals=6
it shows 1.141404 and this is the correct value of free disk space, but then how to put "." what would be 1.141.404
I think you (or me?) have misunderstood something.
In your screenshot I see you have 1.14 TB (in most non-English languages this is written as 1,14 TB) free space. As such there is no reason to put that / those dot(s), to have 1.141.404. Those have to be put only if you don't scale the value.
Now how would you like to see the result: scaled (so as 1.14 TB or 1,14 TB), or unscaled, as 1,254,988,394,496 B (or the corresponding 1.254.988.394.496 B)? Or maybe you'd like some intermediate value, like the one expressed in GB, even if the value is greater than 1 TB?
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: August 27th, 2022, 3:00 pm I think you (or me?) have misunderstood something.
In your screenshot I see you have 1.14 TB (in most non-English languages this is written as 1,14 TB) free space. As such there is no reason to put that / those dot(s), to have 1.141.404. Those have to be put only if you don't scale the value.
Now how would you like to see the result: scaled (so as 1.14 TB or 1,14 TB), or unscaled, as 1,254,988,394,496 B (or the corresponding 1.254.988.394.496 B)? Or maybe you'd like some intermediate value, like the one expressed in GB, even if the value is greater than 1 TB?
it doesn't matter "," or "." I want the value to be 1.141.404 so that there would be a division( , or . ) visually easier to perceive. the system shows that 1.41 is free and a more accurate value (automatic scaling=1 number of decimals =6)
1.141404 (1 TB, 141 GB, 404 MB) but the formula shows generally other values that are not in the screenshot. but I would like to see exactly the value that the system shows (screenshot) and with separation. if it can't be done, then fine.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

Post by balala »

xsander_7 wrote: August 27th, 2022, 3:51 pm it doesn't matter "," or "." I want the value to be 1.141.404 so that there would be a division( , or . ) visually easier to perceive. the system shows that 1.41 is free and a more accurate value (automatic scaling=1 number of decimals =6)
1.141404 (1 TB, 141 GB, 404 MB) but the formula shows generally other values that are not in the screenshot. but I would like to see exactly the value that the system shows (screenshot) and with separation. if it can't be done, then fine.
I think it can be. Here I hope is a solution.
You have to extend the substitution done on the [MeasureFreeDrive2Scaled] measure, ba adding to the end of the option the following substitution:
"^(\d*)\.(\d{3})(\d{3})$":"\1,\2.\3" (add this after the "^(\d{1,3})(\d{3})$":"\1.\2" element of the existing substitution). This way the option looks this way: Substitute="^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1.\2.\3.\4","^(\d{1,3})(\d{3})(\d{3})$":"\1.\2.\3","^(\d{1,3})(\d{3})$":"\1.\2","^(\d*)\.(\d{3})(\d{3})$":"\1,\2.\3".
Obviously the decimal separator I used here is the comma (red in the above option, but you have to look carefully to see it). If needed you can replace it with a dot.
xsander_7
Posts: 14
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

Post by xsander_7 »

balala wrote: August 27th, 2022, 6:39 pm I think it can be. Here I hope is a solution.
You have to extend the substitution done on the [MeasureFreeDrive2Scaled] measure, ba adding to the end of the option the following substitution:
"^(\d*)\.(\d{3})(\d{3})$":"\1,\2.\3" (add this after the "^(\d{1,3})(\d{3})$":"\1.\2" element of the existing substitution). This way the option looks this way: Substitute="^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1.\2.\3.\4","^(\d{1,3})(\d{3})(\d{3})$":"\1.\2.\3","^(\d{1,3})(\d{3})$":"\1.\2","^(\d*)\.(\d{3})(\d{3})$":"\1,\2.\3".
Obviously the decimal separator I used here is the comma (red in the above option, but you have to look carefully to see it). If needed you can replace it with a dot.
you misunderstood me.

here is the code with your last edit and a screenshot of how much free disk space it shows

Code: Select all

[Rainmeter]
Update=1000

[MeasureFreeDrive2]
Measure=FreeDiskSpace
Drive=D:
UpdateDivider=2

[MeasureFreeDrive2Scaled]
Measure=Calc
Formula=(( MeasureFreeDrive2 > ( 1024 ** 2 )) ? ( MeasureFreeDrive2 / ( 1024 ** 2 )) : (( MeasureFreeDrive2 > 1024 ) ? ( MeasureFreeDrive2 / 1024 ): MeasureFreeDrive2 ))
RegExpSubstitute=1
Substitute="^(\d{1,3})(\d{3})(\d{3})(\d{3})$":"\1.\2.\3.\4","^(\d{1,3})(\d{3})(\d{3})$":"\1.\2.\3","^(\d{1,3})(\d{3})$":"\1.\2","^(\d*)\.(\d{3})(\d{3})$":"\1,\2.\3"
[MeasureFreeDrive2Unit]
Measure=Calc
Formula=((( MeasureFreeDrive2 > ( 1024 ** 2 )) ? 2 : (( MeasureFreeDrive2 > 1024 ) ? 1 : 0 )))
Substitute="0":"","1":" k","2":" M","3":" GB"

[MeterDrive]
Meter=STRING
MeasureName=MeasureFreeDrive2Scaled
MeasureName2=MeasureFreeDrive2Unit
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=14
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=D: storage space:#CRLF#%1%2
https://i.ibb.co/wNbWLqV/db9b57f5eb9e.png

and here is a screenshot of how much 1.14 tb should show. you can see the difference in numbers of about 60 GB.
https://i.ibb.co/MSMDKzY/e6dd7c35d56c.png

that is, the formula in the code does not give the values that the system shows

the correct value is shown by the AutoScale=1 parameter, but with this parameter it is not possible to add another separator so that it would turn out to be 0.000.000
https://i.ibb.co/rmdjX3M/d388d03554ef.png a separator is needed between 146 and 495.
Post Reply