It is currently October 13th, 2019, 11:45 pm

hard disk size

Help with creating, editing & fixing problems with skins
xsander_7
Posts: 8
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

xsander_7 » January 5th, 2019, 10:15 pm

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: 8799
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

balala » January 5th, 2019, 10:35 pm

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: 8
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

xsander_7 » January 5th, 2019, 10:40 pm

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: 8799
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: hard disk size

balala » January 5th, 2019, 11:03 pm

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: 8
Joined: January 3rd, 2019, 6:41 pm

Re: hard disk size

xsander_7 » January 5th, 2019, 11:05 pm

balala wrote:
January 5th, 2019, 11:03 pm
Do you like this solution, is it OK?
Yes, there are separators.