Just had a bit of a problem today dealing with displaying file sizes of uploaded reports in an application we are upgrading using Zend Framework. When the files are uploaded, the file sizes are stored in bytes, but for display we need to show the sized in KB as the typical file size is between 60k and 2,048KB (2MB).
Looking through http://php.net I came across some scripts that we could use, but I was looking for a versatile re-useable solution. Well that is when I came across Zend_Measure (http://www.framework.zend.com/manual/en/zend.measure.html).
How did we use it, well, very simply:
Now we have a reusable element which can be used …