как вывести размер свободного места диска в гигабайтах если размер диска 1,8 tb. надо что бы размер был написан (пример) 1050 GB а сейчас выводит 1,0 TB .
how to display the amount of free space of the disk in gigabytes if the size of the disk is 1.8 tb. it is necessary that the size was written (example) 1050 GB and now displays as 1.0 TB .
сейчас так
надо
It is currently April 27th, 2024, 6:57 am
hard disk size
-
- Posts: 14
- Joined: January 3rd, 2019, 6:41 pm
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: hard disk size
Probably the String meter which shows the storage space has an AutoScale=1 option set. Due to this, it scales the space into the best unit possible. If you want to show this information in bytes, kBytes, MBytes or GBytes, but not in TBytes, you have to make manually the conversion.
For example use the following measures:
Code: Select all
[Rainmeter]
Update=1000
[Variables]
Disk=- ENTER HERE THE DRIVE LETTER -
[MeasureTotalDiskSpace]
Measure=FreeDiskSpace
Drive=#Disk#
Total=1
UpdateDivider=5
[MeasureTotalDiskSpaceScaled]
Measure=Calc
Formula=(( MeasureTotalDiskSpace > ( 1024 ** 3 )) ? ( MeasureTotalDiskSpace / ( 1024 ** 3 )) : (( MeasureTotalDiskSpace > ( 1024 ** 2 )) ? ( MeasureTotalDiskSpace / ( 1024 ** 2 )) : (( MeasureTotalDiskSpace > 1024 ) ? ( MeasureTotalDiskSpace / 1024 ): MeasureTotalDiskSpace )))
[MeasureTotalDiskSpaceUnit]
Measure=Calc
Formula=(( MeasureTotalDiskSpace > ( 1024 ** 3 )) ? 3 : (( MeasureTotalDiskSpace > ( 1024 ** 2 )) ? 2 : (( MeasureTotalDiskSpace > 1024 ) ? 1 : 0 )))
Substitute="0":"","1":" k","2":" M","3":" G"
[MeterDrive]
Meter=STRING
MeasureName=MeasureTotalDiskSpaceScaled
MeasureName2=MeasureTotalDiskSpaceUnit
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#Disk# storage space:#CRLF#%1%2B
- [MeasureTotalDiskSpaceScaled] returns the scaled storage space.
- [MeasureTotalDiskSpaceUnit] returns (through a substitution) the used unit (bytes, k, M or G).
-
- Posts: 14
- Joined: January 3rd, 2019, 6:41 pm
Re: hard disk size
Last edited by xsander_7 on January 3rd, 2019, 8:20 pm, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: hard disk size
I think you didn't add the appropriate drive letter to the Disk variable into the [Variables] section. This is an extremely important step to make the skin to work. Please add it and retry the code.
-
- Posts: 14
- Joined: January 3rd, 2019, 6:41 pm
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: hard disk size
Just remove the Total=1 option from the [MeasureTotalDiskSpace] measure.
-
- Posts: 14
- Joined: January 3rd, 2019, 6:41 pm
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: hard disk size
Sorry, what you mean? You or me have any question?
If you are who have question, feel free to ask or to open a new topic if the question is related to a completely different thing.
BTW, I'm glad if you got it working as expected.
-
- Posts: 14
- Joined: January 3rd, 2019, 6:41 pm
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: hard disk size
Ok, doesn't matter. Just post them anytime you have any.