How could I do to remove the dots from a number formats?
For example, I get and copy a value 000,000,000 and paste it into my input
, it would automatically leave this formatting of it and it would be " 000000000 ".
I found a mask, but it is not running here.
My input:
<input type="text" class="form-control" name="var_est" value="" onchange="tiraMascara(this)" placeholder="" data-size="small" mask="#000.000.000.000" data-only-numbers="" required="required" style="width: 100%;">
The mask:
<script>
function removeMaskMoney (x){
x = ""+x;
y = 0;
if ((x.replace(",", ".") != x )){
if (x.replace(".", "") != x ){
aux = x;
x = x.replace(".", "");
x = x.replace(".", "");
}
else {
aux = x;
}
if(x.replace(",", ".") != x){
x = x.replace(",", ".")
}else{
x = aux;
}
}
if (isNaN(parseFloat(x)) ){
x = 0;
}else{
x = parseFloat(x)
}
return x;
}
function tiraMascara(e){
value = removeMaskMoney ($(e).val());
$("[name=var_est_sem_mask]").val( value)
}
</script>