diff --git a/lib/zin/wg/thinktableinput/js/v1.js b/lib/zin/wg/thinktableinput/js/v1.js index 8e3636ac40..cfc99a56a7 100644 --- a/lib/zin/wg/thinktableinput/js/v1.js +++ b/lib/zin/wg/thinktableinput/js/v1.js @@ -25,6 +25,23 @@ window.changePercentInput = function(e) const intValue = value ? parseInt(value, 10) : ''; $(e.target).val(intValue); } + +/** + * 输入框值限制只能输入小数点后两位的数字。 + * The input box value is limited to only two decimal places. + * + * @param Event e Event object + * @returns void + */ +window.changePriceInput = function(e) +{ + const value = $(e.target).val(); + if(value.includes('.') && value.split('.')[1].length > 2) + { + $(this).val(value.slice(0, -1)); + } +} + /** * 设置行号。 * Set line number.