Using excel NumberFormat in coldfusion
Hi All - As suggested by a couple of coldfusion developers a weeks ago, I am using xml to generate excel sheets from coldfusion. I am stuck with the following issue. Style ss:ID=s71 Borders Border ss:Position=Bottom ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Left ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Right ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Top ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ /Borders NumberFormat ss:Format=#,##0/ /Style The number format within Style tags above has pound signs which Coldfusion does not like. Escaping them does not produce the desired result. Can anyone suggest a work around for this issue? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346616 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Using excel NumberFormat in coldfusion
##,0 doesn't work? -Original Message- From: fun and learning funandlrnn...@gmail.com Sent: Tuesday, August 09, 2011 3:18 PM To: cf-talk cf-talk@houseoffusion.com Subject: Using excel NumberFormat in coldfusion Hi All - As suggested by a couple of coldfusion developers a weeks ago, I am using xml to generate excel sheets from coldfusion. I am stuck with the following issue. Style ss:ID=s71 Borders Border ss:Position=Bottom ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Left ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Right ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Top ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ /Borders NumberFormat ss:Format=#,##0/ /Style The number format within Style tags above has pound signs which Coldfusion does not like. Escaping them does not produce the desired result. Can anyone suggest a work around for this issue? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346617 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Using excel NumberFormat in coldfusion
Double # for each # you want to use... -Original Message- From: fun and learning [mailto:funandlrnn...@gmail.com] Sent: Tuesday, August 09, 2011 2:19 PM To: cf-talk Subject: Using excel NumberFormat in coldfusion Hi All - As suggested by a couple of coldfusion developers a weeks ago, I am using xml to generate excel sheets from coldfusion. I am stuck with the following issue. Style ss:ID=s71 Borders Border ss:Position=Bottom ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Left ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Right ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ Border ss:Position=Top ss:LineStyle=Continuous ss:Weight=1 ss:Color=#00/ /Borders NumberFormat ss:Format=#,##0/ /Style The number format within Style tags above has pound signs which Coldfusion does not like. Escaping them does not produce the desired result. Can anyone suggest a work around for this issue? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346620 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Numberformat and cfgrid
Ray Camden has blogged about column rendring, maybe you check that out. On 9/21/07, Steve Sequenzia [EMAIL PROTECTED] wrote: I just need to add commas to a grid column that are displaying numbers. I think I need to use numberformat but I am not sure how to use it. Any help would be great. ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289256 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Numberformat and cfgrid
Hi Steve, I also have a post about cell renderers you can see it here http://www.garyrgilbert.com/blog/index.cfm/2007/8/24/CFGRID-Cell-Renderer-Revisited -- Gary Gilbert http://www.garyrgilbert.com/blog ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289071 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Numberformat and cfgrid
I just need to add commas to a grid column that are displaying numbers. I think I need to use numberformat but I am not sure how to use it. Any help would be great. ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289058 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Numberformat and cfgrid
Ray Camden has blogged about column rendring, maybe you check that out. On 9/21/07, Steve Sequenzia [EMAIL PROTECTED] wrote: I just need to add commas to a grid column that are displaying numbers. I think I need to use numberformat but I am not sure how to use it. Any help would be great. ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289064 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
cfgridcolumn name=Value numberformat=_-_,___,___.00 does not work
cfgridcolumn name=Value numberformat=_-_,___,___.00 does not work Normally in a table this works: #LSNumberFormat(SumInv,_-_,___,___.__)# it will display as : 4,100.00 which is correct. But when in a cgfrid cfgridcolumn name=Invoice_Value numberformat=_-_,___,___.00 but it displays in the grid as: -, 4,100.00 which is incorrect Please Help! Thank You ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274399 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Coldfusion5 + cfgrid + cfgridcolumn numberformat does not work
Hi, Coldfusion5 + cfgrid + numberformat does not work Normall in a table this works: #LSNumberFormat(SumInv,_-_,___,___.__)# it will display as : 4,100.00 which is correct. but when in a cfgrid cfgridcolumn name=Invoice_Value numberformat=_-_,___,___.00 but it displays in the grid as: -, 4,100.00 which is incorrect Anyone help please! Thank You ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274180 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Numberformat not working
That did it. Thanks Peter. On 3/21/07, Peter Boughton [EMAIL PROTECTED] wrote: Try setting type to currency. ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273379 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Numberformat not working
I have this line of code: cfgridcolumn name=TotalMoneySpent header=Total $ Spent On Election numberformat=$__.__ The problem is that I am not getting the properly formatted number. My column just shows someting like 22369.22 rather than @22369.22. In the table, the data is entered as 22369.22 and the field is a type of Money. Thanks, -- Bruce Sorge I'm a mawg: half man, half dog. I'm my own best friend! ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273334 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Numberformat not working
Try setting type to currency. ie: cfgridcolumn name=TotalMoneySpent header=Total $ Spent On Election numberformat=$__.__ type=currency I have this line of code: cfgridcolumn name=TotalMoneySpent header=Total $ Spent On Election numberformat=$__.__ The problem is that I am not getting the properly formatted number. My column just shows someting like 22369.22 rather than @22369.22. In the table, the data is entered as 22369.22 and the field is a type of Money. Thanks, -- Bruce Sorge I'm a mawg: half man, half dog. I'm my own best friend! ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273336 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
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
Re: NumberFormat , Help
I don't think you can do it in one step. However, this should work: #replace(numberFormat(myNumber, 000.00), ., )# cheers, barneyb On 7/26/05, Aldon Moore [EMAIL PROTECTED] wrote: I have a dollar value of ($73.60)thats stored in the database as 73.6. I would like to format this number and display it as a twelve digits (0007360). Similarly if the value is 12 the format shoshould be (0001200) Any help would be appreciated. -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212798 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 , Help
Cheap and nasty: right( YourValue * 1000, 12) HTH Aaron Aldon Moore wrote: I have a dollar value of ($73.60)thats stored in the database as 73.6. I would like to format this number and display it as a twelve digits (0007360). Similarly if the value is 12 the format shoshould be (0001200) Any help would be appreciated. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212800 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 , Help
I have a dollar value of ($73.60)thats stored in the database as 73.6. I would like to format this number and display it as a twelve digits (0007360). Similarly if the value is 12 the format shoshould be (0001200) Any help would be appreciated. #numberformat(n*100,repeatstring(0,12))# s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212825 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 , Help
Isaac, Wouldn't this work as well? #numberformat(var * 100, )# -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 9:40 AM To: CF-Talk Subject: Re: NumberFormat , Help I have a dollar value of ($73.60)thats stored in the database as 73.6. I would like to format this number and display it as a twelve digits (0007360). Similarly if the value is 12 the format shoshould be (0001200) Any help would be appreciated. #numberformat(n*100,repeatstring(0,12))# s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212829 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 , Help
Isaac, Wouldn't this work as well? #numberformat(var * 100, )# It would... I used repeatString(0,12) for legibility -- and because if the length of the string changes, it's easier to change 12 to another number than to count the number of zeroes. 6 of one 1/2 doz. of the other really. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212837 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 , Help
Thanks Guy's Al -Original Message- From: S.Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 12:09 PM To: CF-Talk Subject: RE: NumberFormat , Help Isaac, Wouldn't this work as well? #numberformat(var * 100, )# It would... I used repeatString(0,12) for legibility -- and because if the length of the string changes, it's easier to change 12 to another number than to count the number of zeroes. 6 of one 1/2 doz. of the other really. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212873 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
NumberFormat , Help
I have a dollar value of ($73.60)thats stored in the database as 73.6. I would like to format this number and display it as a twelve digits (0007360). Similarly if the value is 12 the format shoshould be (0001200) Any help would be appreciated. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212796 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
Easy NumberFormat Question
Hello, Is there a number formatting function that will show a maximum of two decimal places when a remainder exists and no decimal places if it doesn't exist? Right now I'm using numberformat and it's showing two decimal places when there is no remainder. I'd just like for those cases to show up as X, not X.00. The last time I did something like this, I did an if statement to check for the remainder and formatted correspondingly. I think that was CF 5. Does a function exist for this? Thanks in advance! Sincerely, Andrew ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185299 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: Easy NumberFormat Question
You can use... cfset myNumber = round(myNumber * 100)/100 To get you desired formatting. -- Jay -Original Message- From: Peterson, Andrew S. [mailto:[EMAIL PROTECTED] Sent: 24 November 2004 15:20 To: CF-Talk Subject: Easy NumberFormat Question Hello, Is there a number formatting function that will show a maximum of two decimal places when a remainder exists and no decimal places if it doesn't exist? Right now I'm using numberformat and it's showing two decimal places when there is no remainder. I'd just like for those cases to show up as X, not X.00. The last time I did something like this, I did an if statement to check for the remainder and formatted correspondingly. I think that was CF 5. Does a function exist for this? Thanks in advance! Sincerely, Andrew ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185302 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: Easy NumberFormat Question
Sierra Bufe submitted this udf to cflib.org: function RoundIt(num,digits) { var i = num; // multiply by 10 to the power of the number of digits to be preserved i = i * (10 ^ digits); // round off to an integer i = Round(i); // divide by 10 to the power of the number of digits to be preserved i = i / (10 ^ digits); // return the result return i; } cfoutput div#roundit(10,2)#/div div#roundit(10.258,2)#/div /cfoutput seems to do what you want. Also seems consistent with James' answer to your question. Hello, Is there a number formatting function that will show a maximum of two decimal places when a remainder exists and no decimal places if it doesn't exist? Right now I'm using numberformat and it's showing two decimal places when there is no remainder. I'd just like for those cases to show up as X, not X.00. The last time I did something like this, I did an if statement to check for the remainder and formatted correspondingly. I think that was CF 5. Does a function exist for this? Thanks in advance! Sincerely, Andrew ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185312 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: Easy NumberFormat Question
Thanks guys. I checked cflib but missed this. Sincerely, Andrew -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 10:24 AM To: CF-Talk Subject: Re: Easy NumberFormat Question Sierra Bufe submitted this udf to cflib.org: function RoundIt(num,digits) { var i = num; // multiply by 10 to the power of the number of digits to be preserved i = i * (10 ^ digits); // round off to an integer i = Round(i); // divide by 10 to the power of the number of digits to be preserved i = i / (10 ^ digits); // return the result return i; } cfoutput div#roundit(10,2)#/div div#roundit(10.258,2)#/div /cfoutput seems to do what you want. Also seems consistent with James' answer to your question. Hello, Is there a number formatting function that will show a maximum of two decimal places when a remainder exists and no decimal places if it doesn't exist? Right now I'm using numberformat and it's showing two decimal places when there is no remainder. I'd just like for those cases to show up as X, not X.00. The last time I did something like this, I did an if statement to check for the remainder and formatted correspondingly. I think that was CF 5. Does a function exist for this? Thanks in advance! Sincerely, Andrew ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185318 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: Easy NumberFormat Question
Thanks guys. I checked cflib but missed this. Sincerely, Andrew Welcome. It was something I'd seen in the code recently at my 9-5 job, otherwise I likely wouldn't have been able to offer the suggestion. :) s. isaac dealey 954.927.5117 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.sys-con.com/story/?storyid=44477DE=1 http://www.sys-con.com/story/?storyid=45569DE=1 http://www.fusiontap.com ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185359 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
numberformat
How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: numberformat
divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: numberformat
Just before you NumberFormat() it... cfset MyValue = MyValue/100 #NumberFormat(MyValue,mask)# Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:42 PM Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
It DOESN'T go into the mask.Do the math, then mask the results. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 12:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
sorry, they were obvious gestures at what we thought was fairly straightforward.the function wont do that basically, not from what i can tell.but, in order to do so, you would have to create a value that is .07 like this... cfset theNumber = 7 / 100 and then you can strip the leading zero off... cfoutput#right(theNumber,3)#/cfoutput but that would only work if you knew the results were going to look like 0.07, the actual value of 7 / 100 in cfmx. there are a myriad of ways to do this, im sure, but you could start here... i couldnt get the mask thingie to work and not show the leading zero?? anyone?? tony -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
that code doesnt make sense? what are you trying to show here? tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
If you're using CF 5 or later you can use this function: cfscript function maskit(myNum) { var aNum = myNum / 100; var newNum = numberFormat(aNum,.00); return (replace(newNum,0.,.); } /cfscript Then in your code, #maskit(7)# Strangely, on my computer, numberFormat(aNum,.00) will STILL put a leading zero on the number -- that's what the replace is for in the return -Original Message- From: J E VanOver [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 12:59 PM To: CF-Talk Subject: RE: numberformat It DOESN'T go into the mask.Do the math, then mask the results. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 12:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
Should be: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) For example: 7/100 = 0.07 mask (#NumberFormat(7,.99)#should output .07(right?) -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat that code doesnt make sense? what are you trying to show here? tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
nahh...the quotes around divideByHundred are not necessary, in fact will throw an error. the correct format for this bit of code would be cfset divideByHundred = NumberFormat('0.07','.__') but that would give you 0.07, not good. the way i posted in my previous email is one way, tho' tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:15 PM To: CF-Talk Subject: RE: numberformat Should be: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) For example: 7/100 = 0.07 mask (#NumberFormat(7,.99)#should output .07(right?) -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat that code doesnt make sense? what are you trying to show here? tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
now theres a novel concept...does that perform better in this instance? nope, cause at the base of the idea... cfset divideByHundred = decimalFormat(0.07) cfoutput#divideByHundred#/cfoutput just gives you the same thing. tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:19 PM To: CF-Talk Subject: RE: numberformat Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
im not sure there is another way to do it..the masks in numberformat() dont produce what you would expect, strange?? tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:19 PM To: CF-Talk Subject: RE: numberformat Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
I think what Mr. Orliniis looking for is something like this. cfset displayNumber = 7/100 cfoutput#numberFormat(displayNumber,'.99')#/cfoutput Now if you wanted to do this in one line, this might work and least in CFMX cfoutput#numberFormat((7/100),'99')#/cfoutput Wow, see the problem here, apparently even though you don't put anything in front of the decimal in the mask, you still get a leading Zero.I guess you would have to string process this then.This is more complex then it needs to be. cfoutput#right(numberformat((7/100),'.__'),len(numberformat((7/100),'.__') )-1)#/cfoutput Anybody explain why you couldn't do this with a mask only? -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 12:58 PM To: CF-Talk Subject: RE: numberformat that code doesnt make sense? what are you trying to show here? tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
thats what i put in my first email, you reiterated perfectly :) not sure, why about the mask that is... that was the first question i asked. tony -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:25 PM To: CF-Talk Subject: RE: numberformat I think what Mr. Orliniis looking for is something like this. cfset displayNumber = 7/100 cfoutput#numberFormat(displayNumber,'.99')#/cfoutput Now if you wanted to do this in one line, this might work and least in CFMX cfoutput#numberFormat((7/100),'99')#/cfoutput Wow, see the problem here, apparently even though you don't put anything in front of the decimal in the mask, you still get a leading Zero.I guess you would have to string process this then.This is more complex then it needs to be. cfoutput#right(numberformat((7/100),'.__'),len(numberformat((7/100),'. __') )-1)#/cfoutput Anybody explain why you couldn't do this with a mask only? -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 12:58 PM To: CF-Talk Subject: RE: numberformat that code doesnt make sense? what are you trying to show here? tony -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
cfset MyNum = 7 #DecimalFormat(MyNum/100)# That will display 7 as .07 Now, if you wanted to parse any passed int that would be easy enough as well. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:25 PM To: CF-Talk Subject: RE: numberformat im not sure there is another way to do it..the masks in numberformat() dont produce what you would expect, strange?? tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:19 PM To: CF-Talk Subject: RE: numberformat Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
0.07 is what that code shows sorry.i thought so too!! tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:45 PM To: CF-Talk Subject: RE: numberformat cfset MyNum = 7 #DecimalFormat(MyNum/100)# That will display 7 as .07 Now, if you wanted to parse any passed int that would be easy enough as well. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:25 PM To: CF-Talk Subject: RE: numberformat im not sure there is another way to do it..the masks in numberformat() dont produce what you would expect, strange?? tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:19 PM To: CF-Talk Subject: RE: numberformat Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: numberformat
This assumes that you never want anything in the 1's place so numbers over 99 are just fubar. If you want any number then I think it would be easy enough to modify. cfset MyNum = 7 #Mid(DecimalFormat(MyNum/100),FindOneOf(DecimalFormat(MyNum/100),1)+1,Len( DecimalFormat(MyNum/100)))# br cfset MyNum = 15 #Mid(DecimalFormat(MyNum/100),FindOneOf(DecimalFormat(MyNum/100),1)+1,Len( DecimalFormat(MyNum/100)))# -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:47 PM To: CF-Talk Subject: RE: numberformat 0.07 is what that code shows sorry.i thought so too!! tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:45 PM To: CF-Talk Subject: RE: numberformat cfset MyNum = 7 #DecimalFormat(MyNum/100)# That will display 7 as .07 Now, if you wanted to parse any passed int that would be easy enough as well. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:25 PM To: CF-Talk Subject: RE: numberformat im not sure there is another way to do it..the masks in numberformat() dont produce what you would expect, strange?? tony -Original Message- From: Schuster, Steven [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 4:19 PM To: CF-Talk Subject: RE: numberformat Why not use DecimalFormat() Steve -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:58 PM To: CF-Talk Subject: RE: numberformat Thanks Robert and all for the suggestions. Robert O. -Original Message- From: Robert Redpath [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:54 PM To: CF-Talk Subject: RE: numberformat Try something like: cfset dividByHundred = (#NumberFormat(yourVar,.99)#/100) -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:43 PM To: CF-Talk Subject: RE: numberformat Thanks. How do I incorporate the / 100 into the mask. I'm new to this and am getting errors. Robert O. -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:37 PM To: CF-Talk Subject: RE: numberformat yeah, i was about to say, math. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 3:35 PM To: CF-Talk Subject: Re: numberformat divide by 100 ;-) I'm not sure you can make a 7 display as a decimal value using masks...but dividing by 100 will get ya there Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Robert Orlini To: CF-Talk Sent: Monday, November 17, 2003 12:17 PM Subject: numberformat How do I apply the numberformat mask to make a 7 view as .07? Thanks. Robert O. _ _ _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
How to use NumberFormat function?
I need to use NumberFormat function to display very big numbers but I couldn't find enough information about the mask parameter. I want to display the number 5E+017 as 50. How can I do this? .murat ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to use NumberFormat function?
http://livedocs.macromedia.com/cfmxdocs/CFML_Reference/functions-pt247.jsp#1110053 -Original Message- From: Murat Demirci [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 1:23 PM To: CF-Talk Subject: How to use NumberFormat function? I need to use NumberFormat function to display very big numbers but I couldn't find enough information about the mask parameter. I want to display the number 5E+017 as 50. How can I do this? .murat ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to use NumberFormat function?
IIRC if the number is longer than a 32 bit number cf will choke. ...tony Tony Weeg Senior Web Developer UnCertified Advanced ColdFusion Developer Information System Design Navtrak, Inc. Mobile workforce monitoring, mapping reporting www.navtrak.net 410.548.2337 -Original Message- From: Murat Demirci [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 1:23 PM To: CF-Talk Subject: How to use NumberFormat function? I need to use NumberFormat function to display very big numbers but I couldn't find enough information about the mask parameter. I want to display the number 5E+017 as 50. How can I do this? .murat ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Another NumberFormat question - brackets for negative numbers
Hi, I cant figure out how to use numberformat to surround negative numbers with brackets. Well, I can, but if I do, it appears that I also have to incorporate the _ or the 9 for place settings, which I do not care for. Any ideas? If there isn't one out there, I will try to roll my own. Thanks, Andrew __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Another NumberFormat question - brackets for negative numbers
You probably have to use an IIF Statement and do some like cfset num=-10) #IIF(num LT 0,'(#right(num,len(num)-1)#)','#num#')# If you dont want. #numberformat(-10,(__.__))# Joe - Original Message - From: Andrew Peterson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 9:40 AM Subject: Another NumberFormat question - brackets for negative numbers Hi, I cant figure out how to use numberformat to surround negative numbers with brackets. Well, I can, but if I do, it appears that I also have to incorporate the _ or the 9 for place settings, which I do not care for. Any ideas? If there isn't one out there, I will try to roll my own. Thanks, Andrew __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Dollarformat -vs- Numberformat
Thanks for the reply, I ended up finding the cluprit in a difference of SQL statements... one page had select round(line.price * line.rec_qty) and another had just sum(line.price * line.rec_qty)... the difference ended up being on the SQL site of things. Thanks again! Hatton Bud wrote: On 4/30/02, Hatton Humphrey penned: Here's the problem: I recently added a summary report to a financial calculation page. The page has been using NumberFormat(tot_tot+misc_tot,9-$999,999,999.99) for several years (the application has been in live use since around 1998). The report that I built is using DollarFormat instead. I was told that several of the totals are coming up fine in a few cases, off by a penny in most cases and off by two pennies in more than a few cases as well. First of all, am I correct in thinking that this is a display issue? Also, which one is more accurate? I think they pretty much work the same. The main thing you need to do is make sure you aren't calculating on a rounded number. You can't calculate on DollarFormat or NumberFormat with a dollar sign as it will return an error, so the problem may be in the tot_tot or misc_tot being calculated on DecimalFormat elsewhere. For instance. cfset tot_tot = 1.022 cfset num1 = tot_tot * 10 returns 10.22 correctly. cfset num2 = DecimalFormat(tot_tot) * 10 returns 10.20, which is off by 2 cents. __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Dollarformat -vs- Numberformat
Okay, this may have been asked a thousand times but I'm going to make it 1001. When comparing the Numberformat and Decimalformat funcitons (for CF 4.x) what is the difference when it comes to rounding and numeric accuracy? Here's the problem: I recently added a summary report to a financial calculation page. The page has been using NumberFormat(tot_tot+misc_tot,9-$999,999,999.99) for several years (the application has been in live use since around 1998). The report that I built is using DollarFormat instead. I was told that several of the totals are coming up fine in a few cases, off by a penny in most cases and off by two pennies in more than a few cases as well. First of all, am I correct in thinking that this is a display issue? Also, which one is more accurate? Thanks! Hatton Humphrey __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Dollarformat -vs- Numberformat
On 4/30/02, Hatton Humphrey penned: Here's the problem: I recently added a summary report to a financial calculation page. The page has been using NumberFormat(tot_tot+misc_tot,9-$999,999,999.99) for several years (the application has been in live use since around 1998). The report that I built is using DollarFormat instead. I was told that several of the totals are coming up fine in a few cases, off by a penny in most cases and off by two pennies in more than a few cases as well. First of all, am I correct in thinking that this is a display issue? Also, which one is more accurate? I think they pretty much work the same. The main thing you need to do is make sure you aren't calculating on a rounded number. You can't calculate on DollarFormat or NumberFormat with a dollar sign as it will return an error, so the problem may be in the tot_tot or misc_tot being calculated on DecimalFormat elsewhere. For instance. cfset tot_tot = 1.022 cfset num1 = tot_tot * 10 returns 10.22 correctly. cfset num2 = DecimalFormat(tot_tot) * 10 returns 10.20, which is off by 2 cents. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Oh, that damn Numberformat!!
I hate NumberFormat(). Can someone please help? I want my numbers to output like this: 123 = 123.00 123.1 = 123.10 123.00 = 123.00 0 = 0.00 What would be the proper mask for this? I've tried 999.00, but then 0 becomes .00. I've tried 990.00, but then 12 becomes 012.00. Arrggg!! BTW, CFMX is cool. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Oh, that damn Numberformat!!
DecimalFormat() ;-) Bryan Stevenson VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 29, 2002 1:54 PM Subject: Oh, that damn Numberformat!! I hate NumberFormat(). Can someone please help? I want my numbers to output like this: 123 = 123.00 123.1 = 123.10 123.00 = 123.00 0 = 0.00 What would be the proper mask for this? I've tried 999.00, but then 0 becomes .00. I've tried 990.00, but then 12 becomes 012.00. Arrggg!! BTW, CFMX is cool. __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Oh, that damn Numberformat!!
I hate NumberFormat(). Can someone please help? I want my numbers to output like this: 123 = 123.00 123.1 = 123.10 123.00 = 123.00 0 = 0.00 What would be the proper mask for this? I've tried 999.00, but then 0 becomes .00. I've tried 990.00, but then 12 becomes 012.00. How about DecimalFormat? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Oh, that damn Numberformat!!
If you are always wanting two decimal places, try #DecimalFormat(number)# Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder I hate NumberFormat(). Can someone please help? I want my numbers to output like this: 123 = 123.00 123.1 = 123.10 123.00 = 123.00 0 = 0.00 What would be the proper mask for this? I've tried 999.00, but then 0 becomes .00. I've tried 990.00, but then 12 becomes 012.00. Arrggg!! BTW, CFMX is cool. __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Oh, that damn Numberformat!!
I have had similar issues when my locale was all messed up (a mixture of windows and cf.) Try using LSNumberFormat - see what results you get. Neil __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Oh, that damn Numberformat!!
maybe: .00 #numberformat(#number#,00)# -- Sam -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 1:55 PM To: CF-Talk Subject: Oh, that damn Numberformat!! I hate NumberFormat(). Can someone please help? I want my numbers to output like this: 123 = 123.00 123.1 = 123.10 123.00 = 123.00 0 = 0.00 What would be the proper mask for this? I've tried 999.00, but then 0 becomes .00. I've tried 990.00, but then 12 becomes 012.00. Arrggg!! BTW, CFMX is cool. __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
NumberFormat() Mask
I need to display a column of percentages, formatted with 2 digits following the decimal place and one, two, or three to the left. I need numbers less than 1 formatted with a leading zero. I'm having a time finding an appropriate NumberFormat() mask to do this. I'm assuming there is one, which could well be wrong. Number Formatted 1.23 1.23 33.4 33.40 78.5178.51 100 100.00 20.20 37 0.37 Anyone know how to do this? The leading zero seems to be the catch. Jim __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: NumberFormat() Mask
I need to display a column of percentages, formatted with 2 digits following the decimal place and one, two, or three to the left. I need numbers less than 1 formatted with a leading zero. I'm having a time finding anappropriate NumberFormat() mask to do this. I'm assuming there is one, which could well be wrong. Number Formatted 1.23 1.23 33.4 33.40 78.5178.51 100 100.00 20.20 37 0.37 Anyone know how to do this? The leading zero seems to be the catch. Try this: NumberFormat(myval, __0.00) Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: NumberFormat() Mask
Thanks, Dave. Dunno why I couldn't find it. It ended up being either ___.__ or ___.00. For some reason __0.00 pads the left hand side with up to three zeroes. Go figure. Jim - Original Message - From: Dave Watts [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 29, 2002 7:05 PM Subject: RE: NumberFormat() Mask I need to display a column of percentages, formatted with 2 digits following the decimal place and one, two, or three to the left. I need numbers less than 1 formatted with a leading zero. I'm having a time finding anappropriate NumberFormat() mask to do this. I'm assuming there is one, which could well be wrong. Number Formatted 1.23 1.23 33.4 33.40 78.5178.51 100 100.00 20.20 37 0.37 Anyone know how to do this? The leading zero seems to be the catch. Try this: NumberFormat(myval, __0.00) Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: NumberFormat UGH
sounds like the problem is with the DB you are using. Not sure how formatting the number with CF once you have pulled it from the db would help. What DB is it you are using? will -Original Message- From: David Schmidt [mailto:[EMAIL PROTECTED]] Sent: 19 April 2002 20:54 To: CF-Talk Subject: RE: NumberFormat UGH Will that work for Income Taxes too??? -Original Message- From: Justin Hansen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 12:48 PM To: CF-Talk Subject: RE: NumberFormat UGH Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
NumberFormat UGH
I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: NumberFormat UGH
Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: NumberFormat UGH
Just kidding I'm at a loss. There may be a UDF at http://www.cflib.org that can help. -Original Message- From: Justin Hansen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:48 PM To: CF-Talk Subject: RE: NumberFormat UGH Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: NumberFormat UGH
Will that work for Income Taxes too??? -Original Message- From: Justin Hansen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 12:48 PM To: CF-Talk Subject: RE: NumberFormat UGH Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: NumberFormat UGH
Been there done that, but I am either not too smart, or there is no way around either having spaces or numbers deleted Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: NumberFormat UGH
Not if you use notepad... Howie - Original Message - From: Justin Hansen [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, April 19, 2002 3:47 PM Subject: RE: NumberFormat UGH Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: NumberFormat UGH
Try #LSParseNumber()# Success is a journey, not a destination!! Doug Brown - Original Message - From: Howie Hamlin [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, April 19, 2002 1:04 PM Subject: Re: NumberFormat UGH Not if you use notepad... Howie - Original Message - From: Justin Hansen [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, April 19, 2002 3:47 PM Subject: RE: NumberFormat UGH Place curser on your NumberFormat and push the F1 key. All answers shall be revealed. :) -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:37 PM To: CF-Talk Subject: NumberFormat UGH I have searched hi and low for some explination, but am at a loss. I have a column in the db: weight, it is a float Values can range beyond 123445.23223 and .03322323 Is there a way to use numberformat so you can show these as they are... when I stick .03322323 into the database, it comes out 3.32232299E-2 Can't use decimalformat, need the multiple decimals ... numberformat either padds too many spaces or doesn't give me enough.. Anyone have any good recommendations for formating variable sized numbers with decimals? Thank Paul Giesenhagen QuillDesign http://www.quilldesign.com SiteDirector v2.0 - Commerce Builder __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
numberformat for SQL ?
Does SQL have something like the CF numberformat ? I need to export a large amount of data to a text file, one of the fields is numeric and I need to left zero fill 5 digits. In CF I would just do this: numbefromat(myfield, 0) I could use CFFILE but its a huge amount of data and it usually ends up killing the server and I would rather not do it in chunks. Thanks,Adrian __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
NumberFormat() Rounding Up
Hello: I have the NumberFormat() func rounding up a number. The result is one integer higher than the original integer. Example: NUMBERFORMAT(5111, '') This yields 5112 on CF 4.5. It's supposed to print 5111. However, if the first number in the string is = 5, the last number is always +1 (so the code above would yield 2). If the first number in the string is =4, the last number is always correct (or 1 in the string above.). If the first number = 9, the last number is always -1 (so the code above would yield 0). This happens on CF 4.5. CF 5.0 does not have this issue, but our commerce system is on 4.5. Any help or logical explanation would be great, because this doesn't make sense to me. -Vinny DiDonato AOL Handle = Vinny49 ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CORRECTION: NumberFormat() Rounding Up
The first line should read: I have the NumberFormat() func formatting a number with zeros. The result is one integer higher than the original integer. I'm assuming its just a bug in Cf 4.5 Do you just need to pad put the string to a set number of characters? If so then you might want to look at adding a series of zeroes manually. ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: ASP NumberFormat
WTF? Is this a joke? -Original Message- From: Chris Maloney [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 8:04 PM To: CF-Talk Subject: RE: ASP NumberFormat Nathan, At first only your newsletters made me wonder about your lack of professionalism. Chris -Original Message- From: Nathan Stanford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:58 AM To: CF-Talk Subject: RE: ASP NumberFormat Your treading on THIN ICE mentioning that COMPETITOR... grin Nathan Stanford Senior Programmer/Analyst [EMAIL PROTECTED] -Original Message- From: Bernd VanSkiver [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:23 AM To: CF-Talk Subject: OT: ASP NumberFormat Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** ~~ 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
OT: ASP NumberFormat
Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ~~ 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
RE: ASP NumberFormat
The VB function to convert to an Integer is CInt(string). Will obviously only work if the string can be converted to an int. However - If I remeber correctly (and it's been a while!) I thought that in ASP you can't delare datatypes for variables. i.e in VB you do: Private myvar as int in ASP you just do: Private myvar So I'm not even sure the CInt function will work or indeed if it's supported in ASP. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]] Sent: 08 May 2001 16:23 To: CF-Talk Subject: OT: ASP NumberFormat Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ~~ 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
RE: ASP NumberFormat
Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. VBScript has a function called FormatNumber: FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits) Note that this doesn't have anything to do specifically with ASP - ASP isn't a language, but a specific object model for CGI-type scripting. So, to answer further VBScript questions, you might want to download the VBScript documentation available from Microsoft: http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe Enjoy! Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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
RE: ASP NumberFormat
http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/doc/vsfc tFormatNumber.htm ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** ~~ 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
RE: ASP NumberFormat
Your treading on THIN ICE mentioning that COMPETITOR... grin Nathan Stanford Senior Programmer/Analyst [EMAIL PROTECTED] -Original Message- From: Bernd VanSkiver [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:23 AM To: CF-Talk Subject: OT: ASP NumberFormat Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ~~ 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
RE: ASP NumberFormat
Nathan, At first only your newsletters made me wonder about your lack of professionalism. Chris -Original Message- From: Nathan Stanford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:58 AM To: CF-Talk Subject: RE: ASP NumberFormat Your treading on THIN ICE mentioning that COMPETITOR... grin Nathan Stanford Senior Programmer/Analyst [EMAIL PROTECTED] -Original Message- From: Bernd VanSkiver [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:23 AM To: CF-Talk Subject: OT: ASP NumberFormat Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ~~ 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
Re: ASP NumberFormat
Chris, How does kidding around with someone show lack of professionalism?? Or did you not bother to read the grin at the end of his post. Attacking someone like that shows a lack of professionalism. Kevin Schmidt - Original Message - From: Chris Maloney [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, May 08, 2001 2:04 PM Subject: RE: ASP NumberFormat Nathan, At first only your newsletters made me wonder about your lack of professionalism. Chris -Original Message- From: Nathan Stanford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:58 AM To: CF-Talk Subject: RE: ASP NumberFormat Your treading on THIN ICE mentioning that COMPETITOR... grin Nathan Stanford Senior Programmer/Analyst [EMAIL PROTECTED] -Original Message- From: Bernd VanSkiver [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 10:23 AM To: CF-Talk Subject: OT: ASP NumberFormat Sorry about bringing ASP in to the list but am having troubles finding the solution and was hoping someone here might know the answer. I am needing a way to format a number in ASP similar to the CF function NumberFormat() Is there a function or something in ASP for this? I'm not sure if ASP even has built in support for this. I am programming the ASP in VBScript. = Bernd VanSkiver [EMAIL PROTECTED] ColdFusion Developer ICQ UIN: 916324 ~~ 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
NumberFormat woes
I feel a little silly about not being able to figure this out... I'm using CF 4.5.1 SP2. I have a list of numbers: 7, 10, 203, 8, 26, etc. I want the single digit numbers to display as two digits (07, 08, etc.). All other numbers should just display as they are (10, 203, 26, etc.). I've tried NumberFormat(mynumber, 00), but then I get an error if there's a three digit number. I've tried NumberFormat(mynumber, 999), but that doesn't display the single digits as two digits. I've tried NumberFormat(mynumber, 900), but that displays the single digits with two leading zeros. I've tried other, similar combinations as well - all with no success. Any ideas? Thanks, Evan -- -=-=-=-=-=-=-=-=-=- Evan Lavidor Circle.com Boston Tel: 617-585-3107 Fax: 617-585-3091 -=-=-=-=-=-=-=-=-=- ~~ 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
Re: NumberFormat woes
cfif num lte 9cfset num = 0#num#/cfif This gives you a string though, so do any calculations before output. - Original Message - From: Evan Lavidor [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 30, 2001 11:36 AM Subject: NumberFormat woes I feel a little silly about not being able to figure this out... I'm using CF 4.5.1 SP2. I have a list of numbers: 7, 10, 203, 8, 26, etc. I want the single digit numbers to display as two digits (07, 08, etc.). All other numbers should just display as they are (10, 203, 26, etc.). I've tried NumberFormat(mynumber, 00), but then I get an error if there's a three digit number. I've tried NumberFormat(mynumber, 999), but that doesn't display the single digits as two digits. I've tried NumberFormat(mynumber, 900), but that displays the single digits with two leading zeros. I've tried other, similar combinations as well - all with no success. Any ideas? Thanks, Evan -- -=-=-=-=-=-=-=-=-=- Evan Lavidor Circle.com Boston Tel: 617-585-3107 Fax: 617-585-3091 -=-=-=-=-=-=-=-=-=- ~~ 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
RE: NumberFormat woes
If all you want to do is display it with a 0 in front, but want to keep it a number for calculations and such, than just do this cfif len(num) eq 1 0#num# cfelse #num# /cfif It'll check to see if it's only 1 digit, and if so, it'll place that 0 in front. Otherwise, just display the number. That way, they'll stay numbers, and not become strings. Stuart Duncan MaracasMedia Inc. At 04:16 PM 4/30/01 -0400, you wrote: irrelevant... you can do calculations via val(string). or you can do cfset like so: cfset num = 0 num and cf creates a num usable in a calculation. at least in vs.4.5.2. Alexander Sicular Chief Technology Architect The Neurological Institute of New York Columbia University 212.305.1318 as867 {at} columbia [dot] edu -Original Message- From: stas [mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 12:49 PM To: CF-Talk Subject: Re: NumberFormat woes cfif num lte 9cfset num = 0#num#/cfif This gives you a string though, so do any calculations before output. - Original Message - From: Evan Lavidor [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 30, 2001 11:36 AM Subject: NumberFormat woes I feel a little silly about not being able to figure this out... I'm using CF 4.5.1 SP2. I have a list of numbers: 7, 10, 203, 8, 26, etc. I want the single digit numbers to display as two digits (07, 08, etc.). All other numbers should just display as they are (10, 203, 26, etc.). I've tried NumberFormat(mynumber, 00), but then I get an error if there's a three digit number. I've tried NumberFormat(mynumber, 999), but that doesn't display the single digits as two digits. I've tried NumberFormat(mynumber, 900), but that displays the single digits with two leading zeros. I've tried other, similar combinations as well - all with no success. Any ideas? Thanks, Evan -- -=-=-=-=-=-=-=-=-=- Evan Lavidor Circle.com Boston Tel: 617-585-3107 Fax: 617-585-3091 -=-=-=-=-=-=-=-=-=- ~~ 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
RE: NumberFormat woes
irrelevant... you can do calculations via val(string). or you can do cfset like so: cfset num = 0 num and cf creates a num usable in a calculation. at least in vs.4.5.2. Alexander Sicular Chief Technology Architect The Neurological Institute of New York Columbia University 212.305.1318 as867 {at} columbia [dot] edu -Original Message- From: stas [mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 12:49 PM To: CF-Talk Subject: Re: NumberFormat woes cfif num lte 9cfset num = 0#num#/cfif This gives you a string though, so do any calculations before output. - Original Message - From: Evan Lavidor [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 30, 2001 11:36 AM Subject: NumberFormat woes I feel a little silly about not being able to figure this out... I'm using CF 4.5.1 SP2. I have a list of numbers: 7, 10, 203, 8, 26, etc. I want the single digit numbers to display as two digits (07, 08, etc.). All other numbers should just display as they are (10, 203, 26, etc.). I've tried NumberFormat(mynumber, 00), but then I get an error if there's a three digit number. I've tried NumberFormat(mynumber, 999), but that doesn't display the single digits as two digits. I've tried NumberFormat(mynumber, 900), but that displays the single digits with two leading zeros. I've tried other, similar combinations as well - all with no success. Any ideas? Thanks, Evan -- -=-=-=-=-=-=-=-=-=- Evan Lavidor Circle.com Boston Tel: 617-585-3107 Fax: 617-585-3091 -=-=-=-=-=-=-=-=-=- ~~ 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
Numberformat question.
I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
can't you output like this: $#numberformat(number,mask)# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 11:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
This isn't pretty, however it does work. CFIF Len(ListLast(Item,".")) EQ 1 #NumberFormat(Item, "$999,999.9")# CFELSEIF Len(ListLast(Item,".")) EQ 2 #NumberFormat(Item, "$999,999.99")# CFELSEIF Len(ListLast(Item,".")) EQ 3 #NumberFormat(Item, "$999,999.999")# CFELSEIF Len(ListLast(Item,".")) EQ 4 #NumberFormat(Item, "$999,999.")# /CFIF Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 10:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
I've been playing with a few different masks, but anytime I set up a decimal mask it's forcing all the places, so for example, if I have the mask set at ",9$99.", the numbers get formatted (using the examples I cited originally) $45.9000, $9.9900, $2.8950 and $0.4585. What I need is $45.90, $9.99, $2.985 and $0.4585. Hatton -Original Message- From: Tumy, Brad [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 12:27 PM To: CF-Talk Subject: RE: Numberformat question. can't you output like this: $#numberformat(number,mask)# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 11:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
Oy, that almost merits being put into a custom tag with as many times as I'm going to have to call it! I had come to the conclusion that I could do something similar to this, but was hoping that there was a way to do it dynamically within the numberformat function. I guess there isn't. Thanks! Hatton -Original Message- From: Larry Juncker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 1:44 PM To: CF-Talk Subject: RE: Numberformat question. This isn't pretty, however it does work. CFIF Len(ListLast(Item,".")) EQ 1 #NumberFormat(Item, "$999,999.9")# CFELSEIF Len(ListLast(Item,".")) EQ 2 #NumberFormat(Item, "$999,999.99")# CFELSEIF Len(ListLast(Item,".")) EQ 3 #NumberFormat(Item, "$999,999.999")# CFELSEIF Len(ListLast(Item,".")) EQ 4 #NumberFormat(Item, "$999,999.")# /CFIF Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 10:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
This isn't pretty, however it does work. CFIF Len(ListLast(Item,".")) EQ 1 #NumberFormat(Item, "$999,999.9")# CFELSEIF Len(ListLast(Item,".")) EQ 2 #NumberFormat(Item, "$999,999.99")# CFELSEIF Len(ListLast(Item,".")) EQ 3 #NumberFormat(Item, "$999,999.999")# CFELSEIF Len(ListLast(Item,".")) EQ 4 #NumberFormat(Item, "$999,999.")# /CFIF A shorter version; #NumberFormat(Item,"$999,999.#RepeatString("9",Len(ListLast(Item,".")))#")# Or, if you always want the 2 digits on the end; #NumberFormat(Item,"$999,999.#RepeatString("9",Max(2,Len(ListLast(Item,".")) ))#")# I haven't tested this, it's just typed... 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Numberformat question.
How do you know which number gets which format? Is there some clue in another db field, or is it based on how many digits after the decimal point, or what? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 1:55 PM To: CF-Talk Subject: RE: Numberformat question. I've been playing with a few different masks, but anytime I set up a decimal mask it's forcing all the places, so for example, if I have the mask set at ",9$99.", the numbers get formatted (using the examples I cited originally) $45.9000, $9.9900, $2.8950 and $0.4585. What I need is $45.90, $9.99, $2.985 and $0.4585. Hatton -Original Message- From: Tumy, Brad [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 12:27 PM To: CF-Talk Subject: RE: Numberformat question. can't you output like this: $#numberformat(number,mask)# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 11:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
Hatton; The code below will do exactly as you ask. Only on the first if statement where I have the mask as .9 change it to .99 and it works fine. Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: Larry Juncker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 12:44 PM To: CF-Talk Subject: RE: Numberformat question. This isn't pretty, however it does work. CFIF Len(ListLast(Item,".")) EQ 1 #NumberFormat(Item, "$999,999.9")# CFELSEIF Len(ListLast(Item,".")) EQ 2 #NumberFormat(Item, "$999,999.99")# CFELSEIF Len(ListLast(Item,".")) EQ 3 #NumberFormat(Item, "$999,999.999")# CFELSEIF Len(ListLast(Item,".")) EQ 4 #NumberFormat(Item, "$999,999.")# /CFIF Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 10:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
RE: Numberformat question.
We just found a ready-made solution to the same problem. Check out Russ Michaels custom tag in the DevEx- cf_zerokiller found at the URL: http://devex.allaire.com/developer/gallery/info.cfm?ID=CA34775F-2830-11D4-AA 9700508B94F380method=Full Does the trick. Too bad NumberFormat() isn't a little smarter. ;) Truman -Original Message- From: Larry Juncker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 2:15 PM To: CF-Talk Subject: RE: Numberformat question. Hatton; The code below will do exactly as you ask. Only on the first if statement where I have the mask as .9 change it to .99 and it works fine. Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: Larry Juncker [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 12:44 PM To: CF-Talk Subject: RE: Numberformat question. This isn't pretty, however it does work. CFIF Len(ListLast(Item,".")) EQ 1 #NumberFormat(Item, "$999,999.9")# CFELSEIF Len(ListLast(Item,".")) EQ 2 #NumberFormat(Item, "$999,999.99")# CFELSEIF Len(ListLast(Item,".")) EQ 3 #NumberFormat(Item, "$999,999.999")# CFELSEIF Len(ListLast(Item,".")) EQ 4 #NumberFormat(Item, "$999,999.")# /CFIF Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 10:36 AM To: CF-Talk Subject: Numberformat question. I have a situation where I need to display a price with either 2, 3 or 4 digits after the decimal place. The database is storing the information properly, but I need to format the display to "trim" the output. For example, I have three prices for four items: Item 1 has a price of 45.9 Item 2 has a price of 9.99 Item 3 has a price of 2.985 Item 4 has a price of 0.4585 I need the price to display as $45.90 for Item 1, $9.99 for Item 2, $2.985 for item 3 and $0.4585 for item 4. I know I can't use DollarFormat, since it trims at two decimal places. The question is, how do I set up the NumberFormat to show the pricing properly when possible top-ends are up to $999,999,999.? TIA Hatton ~~ 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
Fighting with NumberFormat
Hi all, I dunno if anyone has had this problem before, but I have been fighting with NumberFormat for about an hour now... I am getting a Cost Price for a product from a database which stores the price as "Money". So I am trying to keep things consistant remove the extra zeros' that are returned (1234.1200). I'm _trying_ to use NumberFormat(cost_price, "__.__") to format it as "0.00" etc. But I am getting some weird results cost_price=1234.12 = NumberFormat(cost_price, '__.__') =1232. cost_price=50.00 = NumberFormat(cost_price, '__.__') = 50.00 I have used combinations of everything I can think of 1234.1200 = '__.00' = 1232. 50. = '__.00' = 50.00 1234.1200 = '00.9900' = 1234.12 50. = '00.9900' = 50. etc, etc... Can someone PLEASE help me get this consitent... all I want is 2 decimal's after the decimal place, and any number before it. Cameron Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Fighting with NumberFormat
Just try this with your number format #NUMBERFORMAT(1234.1200,'9.99')# Or if its always going to be a Money amount #DOLLARFORMAT(1234.1200)# Hope this helps. Jason E Miller Computer Consultants Unlimited http://www.computercu.com Brainbench Certified Cold Fusion Developer 4.5 Transcript Link: http://www.brainbench.com/transcript.jsp?pid=477741 -Original Message- From: Cameron [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 8:21 PM To: CF-Talk Subject: Fighting with NumberFormat Hi all, I dunno if anyone has had this problem before, but I have been fighting with NumberFormat for about an hour now... I am getting a Cost Price for a product from a database which stores the price as "Money". So I am trying to keep things consistant remove the extra zeros' that are returned (1234.1200). I'm _trying_ to use NumberFormat(cost_price, "__.__") to format it as "0.00" etc. But I am getting some weird results cost_price=1234.12 = NumberFormat(cost_price, '__.__') =1232. cost_price=50.00 = NumberFormat(cost_price, '__.__') = 50.00 I have used combinations of everything I can think of 1234.1200 = '__.00' = 1232. 50. = '__.00' = 50.00 1234.1200 = '00.9900' = 1234.12 50. = '00.9900' = 50. etc, etc... Can someone PLEASE help me get this consitent... all I want is 2 decimal's after the decimal place, and any number before it. Cameron Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ 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