|
|
|||||||
Hi there. Im writing a script to extract free space on a disk drive, which is easy. However the number is in kilobytes. I want to multiply it with 1024 because i need to run the number in another command, however the calculation gives me a negative number. This is because of the limitation in kixtart - what do you other guys do? $RESULT1 = GETDISKSPACE ( "C:\" ) ? $RESULT1 $RESULT2 = $RESULT1*1024 ? $RESULT2 Output: 7673544 -732225536 |
||||||||
|
|
|||||||
You've reached the limit of Integer math - you need to convert to Real numbers.. Code: $Result = 1.0 * GetDiskSpace('C:') $Result = $Result * 1024.0 As long as you start your formula with a Real value (decimal point), Kix will treat the entire expression as a Real value. Glenn |
||||||||
|
|
|||||||
Thanks Glenn. This helped a lot. Thanks! |