0
不太瞭解jquery,但儘管我已經創建了下面的代碼,但IGV美元的字段並不會讓我有兩位小數。未找到兩位十進制jquery
例如,如果我輸入1200給我的216的值時,它應該是216.00
$('.precio').keyup(function() {
var igvdolaresround = (Number($(this).val()) * 18)/100;
var igvdolares = igvdolaresround /* :(not found (igvdolaresround).toFixed(2); */
var totaldolares = ((Number($(this).val()) + igvdolares).toFixed(2));
var igvsoles = ((igvdolares * 2.80).toFixed(2));
var totalsoles = ((totaldolares * 2.80).toFixed(2));
$('#igvdolares').val(igvdolares);
$('#totaldolares').val(totaldolares);
$('#igvsoles').val(igvsoles);
$('#totalsoles').val(totalsoles);
});
function maxLengthCheck(object) {
if (object.value.length > object.maxLength) object.value = object.value.slice(0, object.maxLength)
}
muchas gracias :) – Raul