Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    3
    Member #
    18703
    My friends and I are doing a game called the Stock Market Game 2000, and we are in 1st, so thats cool.

    Anyway, it takes us a while to enter into a calculator how much we make from each stock so I made a simple calculator in javascript to tells us how much we gain or lose from each stock.

    I have basically finished, but I want it to alert differently depending on if we gained or lost money on a stock, so I need a way to tell javascript that a number is negative. I need to use an if statement to tell the script the number is negative. Any help is appreciated.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Code:
    if (number < 0) {
        // it's negative!
    }

  4. #3
    Junior Member
    Join Date
    Apr 2009
    Posts
    3
    Member #
    18703
    alright, well that was not exactly what I ment, but I resolved the problem on my own. I worded the question poorly now that I think about it....anyway a moderator can go ahead and close this thread


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:15 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com