* [task#135046 doing 0.5h 2h] add changePriceInput function of thinktableinput.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user