Mercurial > lada > lada-client
changeset 1126:f1d234a7adc7
merged.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 24 May 2016 10:41:07 +0200 |
parents | f5cc079cd683 (current diff) 4f68511ce7a4 (diff) |
children | 5941ee0c7247 9c8b5cbb929a e4952906634d |
files | |
diffstat | 2 files changed, 44 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/app/view/grid/Messwert.js Tue May 24 10:40:23 2016 +0200 +++ b/app/view/grid/Messwert.js Tue May 24 10:41:07 2016 +0200 @@ -117,9 +117,21 @@ editor: { xtype: 'expnumberfield', allowBlank: false, + maxValue: 9.99e+99, + minValue: 1e-99 }, renderer: function(value) { - return value.toExponential(2).toString().replace('.', ','); + if (!value || value === '') { + return value; + } + var strValue = value.toExponential(2).toString() + .replace('.', Ext.util.Format.decimalSeparator); + var splitted = strValue.split('e'); + var exponent = parseInt(splitted[1]); + return splitted[0] + 'e' + + ((exponent < 0) ? '-' : '+') + + ((Math.abs(exponent) < 10) ? '0' : '') + + Math.abs(exponent).toString(); } }, { header: 'Messeinheit', @@ -163,13 +175,22 @@ dataIndex: 'nwgZuMesswert', width: 80, editor: { - xtype: 'expnumberfield' + xtype: 'expnumberfield', + maxValue: 9.99e+99, + minValue: 1e-99 }, renderer: function(value) { if (!value || value === '') { return value; } - return value.toExponential(2).toString().replace('.', ','); + var strValue = value.toExponential(2).toString() + .replace('.', Ext.util.Format.decimalSeparator); + var splitted = strValue.split('e'); + var exponent = parseInt(splitted[1]); + return splitted[0] + 'e' + + ((exponent < 0) ? '-' : '+') + + ((Math.abs(exponent) < 10) ? '0' : '') + + Math.abs(exponent).toString(); } }, { header: 'Grenzwertüberschreitung',
--- a/app/view/grid/Probenzusatzwert.js Tue May 24 10:40:23 2016 +0200 +++ b/app/view/grid/Probenzusatzwert.js Tue May 24 10:41:07 2016 +0200 @@ -94,12 +94,21 @@ flex: 1, editor: { xtype: 'expnumberfield', + maxValue: 9.99e+99, + minValue: 1e-99 }, renderer: function(value) { if (!value || value === '') { return value; } - return value.toExponential(2).toString().replace('.', ','); + var strValue = value.toExponential(2).toString() + .replace('.', Ext.util.Format.decimalSeparator); + var splitted = strValue.split('e'); + var exponent = parseInt(splitted[1]); + return splitted[0] + 'e' + + ((exponent < 0) ? '-' : '+') + + ((Math.abs(exponent) < 10) ? '0' : '') + + Math.abs(exponent).toString(); } }, { header: '< NWG', @@ -119,12 +128,21 @@ flex: 1, editor: { xtype: 'expnumberfield', + maxValue: 9.99e+99, + minValue: 1e-99 }, renderer: function(value) { if (!value || value === '') { return value; } - return value.toExponential(2).toString().replace('.', ','); + var strValue = value.toExponential(2).toString() + .replace('.', Ext.util.Format.decimalSeparator); + var splitted = strValue.split('e'); + var exponent = parseInt(splitted[1]); + return splitted[0] + 'e' + + ((exponent < 0) ? '-' : '+') + + ((Math.abs(exponent) < 10) ? '0' : '') + + Math.abs(exponent).toString(); } }, { header: 'Maßeinheit',