Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NumberFormat Assistance 2

Status
Not open for further replies.

rojas1mg

Programmer
Jun 15, 2004
119
0
0
US
I'm having a heck of a time with the NumberFormat. I'm trying to format a dynamic number to show commas in the proper place (i.e. 3000 should be 3,000, or 3000000 should be 3,000,000). This is what I have tried and it's not displaying properly:
Code:
NumberFormat(#annual#,mask,)

rojas1mg - - - I love Tek-Tips and all members who reply.
 
You mean:
Code:
NumberFormat(#annual#,'9,999,999.99',)



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
This is what is displaying on my page:
Code:
NumberFormat(62500, 9,999,999.99,)

What am I doing wrong? Here's my line of code:
Code:
<TD class="total">NumberFormat(#annual#, 9,999,999.99,)</TD>

rojas1mg - - - I love Tek-Tips and all members who reply.
 
you need to put your mask in quotes. either single or double.

'9,999,999.99' or "9,999,999.99"

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
This is what I ended up having to put:
Code:
<cfoutput>#NumberFormat(annual, '99,999,999.99')#</cfoutput>
And now it works. Thanks. I needed the <cfoutput> before and after although I thought one at the top & bottom of my CFM page would suffice....NOPE! Also had to take the #'s from the "annual" off and wrap the whole NumberFormat with it. Thanks

rojas1mg - - - I love Tek-Tips and all members who reply.
 
If you don't have a book that you can use to look up the syntax for functions and tags you can use the MM live docs website. here is the index.


A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top