forked from extern/egroupware
Make precision option only for sum value
This commit is contained in:
parent
ed32bd4c01
commit
0ecad4641b
@ -51,7 +51,7 @@ var et2_entry = et2_valueWidget.extend(
|
|||||||
},
|
},
|
||||||
precision: {
|
precision: {
|
||||||
name: 'Decimals to be shown',
|
name: 'Decimals to be shown',
|
||||||
description: 'Specifies the number of decimals on a float value, the default is 2',
|
description: 'Specifies the number of decimals for sum of alternates, the default is 2',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '2'
|
default: '2'
|
||||||
},
|
},
|
||||||
@ -151,10 +151,11 @@ var et2_entry = et2_valueWidget.extend(
|
|||||||
}
|
}
|
||||||
if(this.options.field == 'sum')
|
if(this.options.field == 'sum')
|
||||||
{
|
{
|
||||||
|
if (this.options.precision && jQuery.isNumeric(sum)) sum = parseFloat(sum).toFixed(this.options.precision);
|
||||||
widget.options.value = sum;
|
widget.options.value = sum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.options.precision) widget.options.value = parseFloat(widget.options.value).toFixed(this.options.precision);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user