Basically, I'm trying to capture the FreeDiskSpace and add a B at the end. And if the FreeDiskSpace is 0.00 B then show the text. I don't know anything about RegEx other than what's below!
sl23 wrote: ↑August 7th, 2021, 4:03 pm
Basically, I'm trying to capture the FreeDiskSpace and add a B at the end. And if the FreeDiskSpace is 0.00 B then show the text. I don't know anything about RegEx other than what's below!
I'm just guessing since I didn't try it, but I think you are pretty close... the catch is that the measure returns the number of bytes (an integer), not a decimal value. So you'd need to use something like Substitute="^(.+)$":"\1 B";"0 B":"No Drive".
This scheme isn't really going to work unless you really do want to show the disk space value in bytes. If you want megabytes, gigabytes, etc., then you'll need a different approach. Let the meter control the numeric scaling, and add additional measures to handle the case where the bytes is 0.
sl23 wrote: ↑August 7th, 2021, 4:27 pm
Thanks for the help, but that doesn't work if the drive is 1TB or more and still doesn't change the 0.00 to No Drive.
See my post above. The FreeDiskSpace measure does not return 0.00. It returns an integer value.
SilverAzide wrote: ↑August 7th, 2021, 4:26 pm
I'm just guessing since I didn't try it, but I think you are pretty close... the catch is that the measure returns the number of bytes (an integer), not a decimal value. So you'd need to use something like Substitute="^(.+)$":"/1 B";"0 B":"No Drive".
This scheme isn't really going to work unless you really do want to show the disk space value in bytes. If you want megabytes, gigabytes, etc., then you'll need a different approach. Let the meter control the numeric scaling, and add additional measures to handle the case where the bytes is 0.
Nah, just shows the RegEx and a B after it lol : ^(.+)$ B
EDIT: Now it shows /1 B
Last edited by sl23 on August 7th, 2021, 4:33 pm, edited 1 time in total.
Oops! Wrong slash Substitute="^(.+)$":"\1B";"0B":"No Drive"
Close, but now I get 0.00 B displayed. So I tried 0B, 0 B, 0.00B and 0.00 B, still no luck!