View Single Post
12-27-2007, 05:17 PM
Join Date: Dec 2007
Location: Bucharest, Romania
No, PHP doesn't have what you want, but you could easily write your own functions (it's actually pretty easy). All you have to do is some basic math. Every next measurement unit is the previous measurement unit * 1024.
- 1 kilobyte (KB) = 1,024 bytes
- 1 megabyte (MB) = 1 KB * 1024 = 1024 * 1024 = 1,048,576 bytes
- 1 gigabyte (GB) = 1MB * 1024 = ( 1024 * 1024 ) * 1024 = 1,073,741,824 bytes
And no, you can't 'just round down the values to 1000'. In programming, that doesn't work - by doesn't work I mean you won't get the right values. In marketing, it does (see the storage devices).
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
View Public Profile
Send a private message to xenon
Visit xenon's homepage!
Find More Posts by xenon