How to add a point with two digits 00 on this script?
The price will all time ending on .00
<script type="text/javascript">
$(document).ready(function()
{
$(".one_input").unwrap();
});
</script>
<script>
$('#priceMin').keyup(function(event) {
// skip for arrow keys
if(event.which >= 37 && event.which <= 40){
event.preventDefault();
}
$(this).val(function(index, value) {
value = value.replace(/,/g,'');
return numberWithCommas(value);
});
});
function numberWithCommas(x) {
var parts = x.toString().split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return parts.join(".");
}
</script>
Thanks