12-27-2007, 05:17 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
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.
|
|
|
|