www.webdeveloper.com
Results 1 to 2 of 2

Thread: Price calculation

  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Talking Price calculation

    need to make calculation such that when user enters the value "$" sign should be concatenated with that and when user enters 10.44 the o/p should be $10.44. if the user enters 10 the o/p should be $10.00 and if the user enters 100.21 the o/p should be $100.21 .. i need to do this using padding

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,410

    Lightbulb

    Quote Originally Posted by prabhujaba View Post
    need to make calculation such that when user enters the value "$" sign should be concatenated with that and when user enters 10.44 the o/p should be $10.44. if the user enters 10 the o/p should be $10.00 and if the user enters 100.21 the o/p should be $100.21 .. i need to do this using padding
    Where is the calculation?

    To concatenate the '$' character, it would be something like ...
    Code:
    var userValue = document.getElementById('userInput').value;
    document.getElementById('displayCalc').value = '$'+userValue;
    but it might vary depending upon your surrounding code
    which I do not see.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles