- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
numFloat = [
'#fact_sheet_general_data_lines_3_PKH_LENG',
'#fact_sheet_general_data_lines_8_IFI_SHAR',
'#fact_sheet_general_data_lines_10_IFI_GRAN',
'#fact_sheet_general_data_lines_5_OFC_SHAR',
'#fact_sheet_general_data_lines_6_OFC_EQBL'
];
inputNumFloat(numFloat);
function inputNumFloat(ids, pos) {
var i;
pos = typeof pos !== 'undefined' ? pos : 2;
for(i = 0; i < ids.length; i++) {
$(ids[i]).on('blur', function(){
if ($(this).val() == '') {
$(this).val('0');
} else {
var val = parseFloat($(this).val().replace(',', '.'));
if (isNaN(val)) { val = 0; }
$(this).val(val.toFixed(pos));
}
});
$(ids[i]).blur();
}
}