bytes, in the form of long long, are current converted to an NSString using a custom util function that assumes kilo = 1000. (As was the standard since macOS 10.6)
However, in macOS 10.8, Apple added the NSByteCountFormatter API to Foundation, which not only adds this functionality built in, but can also use the appropriate kilo value based on the OS it's currently running on. NSByteCountFormatter also supports storage increments greater than TB, incase anyone is every thing to trash a files more than 1000 TB in size 😂
I've updated the util file to check for the presence of NSByteCountFormatter and use it if possible, and if not to default to the legacy method.
bytes, in the form of
long long
, are current converted to an NSString using a custom util function that assumes kilo = 1000. (As was the standard since macOS 10.6)However, in macOS 10.8, Apple added the
NSByteCountFormatter
API toFoundation
, which not only adds this functionality built in, but can also use the appropriatekilo
value based on the OS it's currently running on.NSByteCountFormatter
also supports storage increments greater than TB, incase anyone is every thing to trash a files more than 1000 TB in size 😂I've updated the util file to check for the presence of
NSByteCountFormatter
and use it if possible, and if not to default to the legacy method.