> 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?
>
> I found #LSNumberFormat(InSol.Filesize,"___,___,___")# to add commas, but
> i cant find any obvious way of converting it to 12.0 MB.

The obvious way is
#NumberFormat(InSol.FileSize/(1024*1024),"___,___,___.0")#MB

The 1024*1024 is for the exact number of bytes in a mega-byte - more
accurate than 1,000,000

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to