1
How could I do to remove points from a number formats?
For example, I take and copy a value 000.000.000 and I’ll put it on mine input
, it would automatically leave this formatting of it and would "000000000".
I found a mask, only she’s 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>