Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

display amount with currency for jquery

$(document).ready(function(){
  $('#test').click(function() {
    TESTCURRENCY = $('#value').val().toString().match(/(?=[sd])(?:s.|d+(?:[.]d+)*)/gmi);
    if (TESTCURRENCY.length <= 1) {
      $('#valueshow').val(
        parseFloat(TESTCURRENCY.toString().match(/^d+(?:.d{0,2})?/))
      );
    } else {
      $('#valueshow').val('Invalid a value!');
    }
  });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #amount #currency #jquery
ADD COMMENT
Topic
Name
4+5 =