|I'm trying to convert file sizes from bytes into the largest unit with a whole number. So 1025 bytes i'd like to convert to kilobytes and 2197152 would be converted to megabytes.|
I was well on my way with an if greater than 1023 divide by 1024, and then repeat that until it's less than 1024. But I found out set /a rounds to whole numbers.
Is there a simple way to get around this or a cmd line program to do accurate math?
Now that I say that I just learned how to use arguments with a VB program. I guess I could code up a simple VB program to do the math and return a value and unit. Is there a way to return a value back to the batch script or would i just have to use a temp file?
Any other ideas are greatly appreciated.