/stock-profit-loss

Webapp based on VanillaJS. Know the profir/loss you made on your stock.

Primary LanguageJavaScript

Stock: Profit or Loss?

Webapp based on VanillaJS. Helps the user to find the amount of profit or loss made on a particular stock.

Working

  1. The user enters the cost price, quantity of stock and the current price of the stock and then clicks on the CHECK button.
  2. The app first checks if all the input fields are filled or not. If not an alert is thrown to the user.
  3. Then all input values are stored in respective variables.
  4. If the current price is greater than the cost price it is a profit for the user. Profit amount and percentage is calculated and displayed in the output section ofr the user.
  5. If the current price is less than the cost price it is a loss for the user. Loss amount and percentage is calculated and displayed in the output section for the user.