Take number, divide by 1,048,576 (a megabyte is exactly that
many bytes) which si why when you say you have 128MB of ram.. you really
have
134,217,728 bytes of memory.. hehehe..

Okay enough technical nit picking..

Divide the number by the number I said, take the first decimal point.
Slap a MB on there.. voila.

Jeremy Allen
elliptIQ Inc.


>-----Original Message-----
>From: Thomas Chiverton [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 06, 2001 10:46 AM
>To: CF-Talk
>Subject: RE: converting a number to XXMB
>
>
>> I have a file upload application, and i store the size of the file into a
>> database. The number is something like this: 12034806
>> How can i convert this number to 12.0MB?
>
>Divide by 1000000, then print it with the appropiete number of decimal
>points (LSNumberFormat (number,"99.9") or something )
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to