Skip to content

Commit

Permalink
[IMP] web_decimal_numpad_dot: use the decimal_point defined in user l…
Browse files Browse the repository at this point in the history
…anguage
  • Loading branch information
Roel Adriaans authored and oihane committed Jun 23, 2016
1 parent 6aadb57 commit 6cedf01
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions web_decimal_numpad_dot/static/src/js/numpad_dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
}
},
floatKeypress: function(e){
if(e.keyCode == '46' || e.charCode == '46'){
//Cancel the keypress
if (e.keyCode == '46' || e.charCode == '46') {
// Cancel the keypress
e.preventDefault();
// Add the comma to the value of the input field
this.$("input").val(this.$("input").val() + ',');
this.$("input").val(this.$("input").val() + instance.web._t.database.parameters.decimal_point);
}
else if (e.keyCode == '44' || e.charCode == '44') {
// Cancel the keypress
e.preventDefault();
// Add the comma to the value of the input field
this.$("input").val(this.$("input").val() + instance.web._t.database.parameters.thousands_sep);
}
},
});
})();

0 comments on commit 6cedf01

Please sign in to comment.