I have a code that calculates the amount of rolls required according to the width and height of the person's wall. Currently the code for the comma mask is this:
$('.virgula').mask('####00,00', {reverse: true});
$("#altura").focusout(function (){
try{
var altura = parseFloat( $("#altura").val().replace(',','.') );
var largura = parseFloat( $("#largura").val().replace(',','.') );
var divisor = 1.20;
var resultado = largura / divisor;
That is, when the person types "1" and "5" the number appears as 15 meters and only after it enters the "0" is that it appears 1.50 meters.
I would like to know if there is a possibility of the number appearing as "1,5" with two digits, as if the mask was "## 0,0" and after two digits it returns to the mask "#### 00.00 ". I've tried some IFs and nothing.