Could you post the entirety of your code? The problem is not only with the calc, but also potentially with the source measure.
I'm guessing from the topic title that MeasureFolderSizeStr is using the FileListPlugin to read the size of the dropbox folder. If that's the case, then your problem is that it returns the value as a string, not a number. You will need to add a substitution to get rid of the characters that Calc does not understand. First, make sure that the measure does not contain the line "Format=Dynamic" or "Format=KBytes". Then, add the following line to your measure:
As far as I know, the only characters you need to get rid of are the commas that separate the thousands and the "b" at the end. This line should force the measure to return the size of the folder in bytes. Next, the calc measure should look like this:
Code: Select all
Measure=Calc
Formula=2*(2**30)-[MeasureFolderSizeStr0]
DynamicVariables=1
The first bit, "2*(2**30)", calculates the number of bytes in 2 GB (ie: your dropbox limit). I don't know why you were using 2000, but that number is incorrect. The folder's size is measured in bytes. There are 1024 bytes in a kilobyte, 1024 kilobytes in a megabyte and 1024 megabytes in a gigabyte. That means that one gigabyte is 1024 x 1024 x 1024 bytes. Since 1024 is actually 2
10, I've just simplified that into "1 gigabyte = 2
30 bytes" (in Rainmeter, the symbol for exponents is "**"). Then since you have 2 GB of storage, you just need to double that number.
The second part of that formula is the important part. Because we want the Calc measure to use the value from the other measure
after the substitution, we must use it as a dynamic variable. To do that, you simply add [Square Brackets] around the measure's name, and then add the line "DynamicVariables=1" at the end.
And there you have it. That should measure the amount of space you have left in your dropbox folder.