* [task#135046 doing 0.5h 2h] add changePriceInput function of thinktableinput.

This commit is contained in:
zhangyu
2024-12-20 10:47:00 +08:00
committed by 孙浩
parent 230da6e2e4
commit 0913161fbc
+17
View File
@@ -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.