Answers for "allow 2 decimal places in input type= number js"

16

javascript show 2 decimal places

var myNumber=12.2345;
var myNumberWithTwoDecimalPlaces=parseFloat(myNumber).toFixed(2); //12.23
Posted by: Guest on July-31-2019
-2

javascript - How to use limit input to 2 decimal places

//HazaaZOOZ - javascript - How to use limit input to 2 decimal places

var validate = function(e) {
  var t = e.value;
  e.value = (t.indexOf(".") >= 0) ? (t.substr(0, t.indexOf(".")) + t.substr(t.indexOf("."), 3)) : t;
}
Posted by: Guest on February-04-2021

Code answers related to "allow 2 decimal places in input type= number js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language