Guest cory feco Posted August 11, 2009 Report Share Posted August 11, 2009 (edited) I'm sure this is a simple fix but I can't find the answer through searching, how do I get a form that computes a mathematical formula (like 3-2=(1) or whatever) to show up blank if the answer is 0? I want a number for every other number BUT zero, if its zero I want it to be as if there is nothing in that box.... but not a number showing there's nothing in that box (like 2-2=( ))! Can someone please help me? Edited August 11, 2009 by cory feco Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted August 11, 2009 Report Share Posted August 11, 2009 Can you show us what you have so far (include HTML and JavaScript) Link to comment Share on other sites More sharing options...
Ingolme Posted August 11, 2009 Report Share Posted August 11, 2009 That's what the if() statement is for.Here's q quick example: function sum(x,y) { var Z = x + y; if(Z == 0) Z = ""; return Z;}sum(3,-3); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now