Yeah, it can be right. But the result is very strange, I’m sure that the number 100 or 1024 is not the point.
And, for Snow Leopard, the right number can be 1000 not 1024, right?
set theSize to "23483284"
set textString1 to my formatSize(theSize, "MB")
set textString2 to my formatSize(theSize, "GB")
on formatSize(value, mode)
if mode = "MB" then
set value to value / (1024 ^ 2)
else if mode = "GB" then
set value to value / (1024 ^ 3)
end if
if value > 1000.0 then
return ((round value) as text) & space & mode
else
return (((round (value * 100)) / 100) as text) & space & mode
end if
end formatSize
textString1 & space & textString2
I’d like to know the answer to this one too, as I’d heard of Snow Leopard’s “rounding” of the 1024 value. I was wondering if it’s just GUI or does it affect AppleScript and behind-the-scenes too.
I sure hope it’s just GUI…I’d hate to think Operating System companies had to cave-into marketers…and this coming from someone in marketing.
I’d like to know the answer to this one too, as I’d heard of Snow Leopard’s “rounding” of the 1024 value. I was wondering if it’s just GUI or does it affect AppleScript and behind-the-scenes too.
I sure hope it’s just GUI…I’d hate to think Operating System companies had to cave-into marketers…and this coming from someone in marketing.