NumberFormat problem
What am I missing here? I want to set a simple number format function but I can't get the decimal in the right place, tried forcing the integer to the left, tried dashes, single quotes around the mask, etc. Nothing works. cfscript VARIABLES.someVar = 350 VARIABLES.digit2 = Left(VARIABLES.someVar, 2); VARIABLES.ImageMaxFileSize1 = #NumberFormat(VARIABLES.digit2, L.9)#mb; /cfscript cfoutput#VARIABLES.ImageMaxFileSize1#/cfoutput I want the output to be 3.5mb Thanks, Mark ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234236 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: NumberFormat problem
Hey Mark, how about this: cfscript VARIABLES.someVar = 350; VARIABLES.digit2 = VARIABLES.someVar / 1024 / 1024; VARIABLES.ImageMaxFileSize1 = NumberFormat(VARIABLES.digit2, ,._) mb; writeOutput( VARIABLES.ImageMaxFileSize1 ); /cfscript Mingo. Mark Leder wrote: What am I missing here? I want to set a simple number format function but I can't get the decimal in the right place, tried forcing the integer to the left, tried dashes, single quotes around the mask, etc. Nothing works. cfscript VARIABLES.someVar = 350 VARIABLES.digit2 = Left(VARIABLES.someVar, 2); VARIABLES.ImageMaxFileSize1 = #NumberFormat(VARIABLES.digit2, L.9)#mb; /cfscript cfoutput#VARIABLES.ImageMaxFileSize1#/cfoutput I want the output to be 3.5mb Thanks, Mark ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234237 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: NumberFormat problem
That worked. Thanks! Thanks, Mark -Original Message- From: Mingo Hagen [mailto:[EMAIL PROTECTED] Sent: Monday, March 06, 2006 11:01 AM To: CF-Talk Subject: Re: NumberFormat problem Hey Mark, how about this: cfscript VARIABLES.someVar = 350; VARIABLES.digit2 = VARIABLES.someVar / 1024 / 1024; VARIABLES.ImageMaxFileSize1 = NumberFormat(VARIABLES.digit2, ,._) mb; writeOutput( VARIABLES.ImageMaxFileSize1 ); /cfscript Mingo. Mark Leder wrote: What am I missing here? I want to set a simple number format function but I can't get the decimal in the right place, tried forcing the integer to the left, tried dashes, single quotes around the mask, etc. Nothing works. cfscript VARIABLES.someVar = 350 VARIABLES.digit2 = Left(VARIABLES.someVar, 2); VARIABLES.ImageMaxFileSize1 = #NumberFormat(VARIABLES.digit2, L.9)#mb; /cfscript cfoutput#VARIABLES.ImageMaxFileSize1#/cfoutput I want the output to be 3.5mb Thanks, Mark ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234238 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: NumberFormat problem
cfscript VARIABLES.someVar = 350; VARIABLES.digit2 = VARIABLES.someVar / 1024 / 1024; VARIABLES.ImageMaxFileSize1 = NumberFormat(VARIABLES.digit2, ,._) mb; writeOutput( VARIABLES.ImageMaxFileSize1 ); /cfscript Wouldn't cfscript variables.someVar = '350'; writeOutput(numberFormat(variables.someVar / 1048576 , ,._) mb); /cfscript Be a little faster ;) NOTE: kidding, please don't flame me! -- Jay ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234245 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54