mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 08:19:45 +01:00
Add precision option to entry widget
This commit is contained in:
parent
e8bc6dcd19
commit
24b7137b1c
@ -49,6 +49,12 @@ var et2_entry = et2_valueWidget.extend(
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
default: et2_no_init
|
default: et2_no_init
|
||||||
},
|
},
|
||||||
|
precision: {
|
||||||
|
name: 'Decimals to be shown',
|
||||||
|
description: 'Specifies the number of decimals on a float value, the default is 2',
|
||||||
|
type: 'string',
|
||||||
|
default: '2'
|
||||||
|
},
|
||||||
value: {
|
value: {
|
||||||
type: 'any'
|
type: 'any'
|
||||||
},
|
},
|
||||||
@ -148,6 +154,7 @@ var et2_entry = et2_valueWidget.extend(
|
|||||||
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