Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 04-11-2011, 11:31 AM
kash's Avatar
kash kash is offline
Member
 
Join Date: 03-20-11
Location: UK
Posts: 40
iTrader: 0 / 0%
Hide javaScript infinity from displaying?

I have got about 10 if else statements that calculates depending on the users selection.
The problem is when the user decides to not use one of the boxes they can delete the number or put zero.
My scripts then does the calculations based on that and displays infinity one of the columns.
I dont want Infinity to display, i want just blank or some dashes (--) or something to display.

I can fix this but because I have a long if else script it will have to be done the very long way, what I can think off is solving by more if and else...

Is there a way of sorting this in a not so long way?

Or if I put another function to run after the infinity calc is done and displayed, the other function will over write it (of course this will be in less then a second), would this always work all the time, and on all browsers?

Last edited by kash; 04-11-2011 at 11:41 AM.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 04-11-2011, 05:35 PM
nafirici nafirici is offline
Contributing Member
 
Join Date: 03-06-11
Posts: 67
iTrader: 0 / 0%
could you post a sample of your code?
 
Reply With Quote
  #3  
Old 04-26-2011, 01:44 PM
kash's Avatar
kash kash is offline
Member
 
Join Date: 03-20-11
Location: UK
Posts: 40
iTrader: 0 / 0%
I solved it now by doing some copying and pasting.

I pasted this on each line (highlighted):

....value==0?"--":A.toFixed(2)
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which article software writer is better? Instant article wizard or content infinity jennypretty Marketing Forum 16 09-07-2011 11:09 PM
Chrome not displaying ' properly in javascript alter-ego Coding Forum 3 05-19-2010 08:15 AM
Infinity Web Directory///Free Submissions! sup3rnova Directory Announcements & Promotions 6 10-29-2006 03:01 PM
Anyone Know About Infinity Web Services? SN3 Web Hosting Forum 4 02-07-2005 06:41 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:40 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC