Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

number format mask for 'blank' if zero number?

Posted on 2005-05-01
4
Medium Priority
?
919 Views
Last Modified: 2013-12-24
I need to use #numberforma(n,'')# to display numbers '9,999' - which works great ...
EXCEPT ... I need to display NOTHING (not zero!) IF the number 'n' is 0.

Is this possible? I've looked at the mask parameters and I don't see that option!

Thanks.
R.
0
Comment
Question by:rcbuchanan
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
INSDivision6 earned 1000 total points
ID: 13905064
<cfif num=NumberFormat(number)>  <!--- or with a mask, if needed --->
<cfif num EQ 0>
   <cfset num="">
</cfif>
<cfoutput>#num#</cfoutput>
0
 
LVL 55

Assisted Solution

by:Ryan Chong
Ryan Chong earned 1000 total points
ID: 13905072
try like:

...

<cfif isnumeric(n)>
  <cfif n eq 0>
      <cfset outputstr = #numberforma(n,'')#>
  <cfelse>
      <cfset outputstr = "">
  </cfif>
<cfelse>
  <cfset outputstr = "">
</cfif>

<cfoutput>outputstr = #outputstr#</cfoutput>

...
0
 

Author Comment

by:rcbuchanan
ID: 13905281
nope. i was hoping i missed something with the numberformat mask!?
oh well.
0
 
LVL 7

Expert Comment

by:INSDivision6
ID: 13906585
Definetly wrong answer from ryancys.  Original number and number after NumberFormat() can give different results for <cfif n EQ 0>
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Screencast - Getting to Know the Pipeline
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question