comparison app/model/Zusatzwert.js @ 1065:7fa853864d9b

show trailing '0' in exponential notation.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 10 Mar 2016 10:45:50 +0100
parents 7e801af49eeb
children 1d20cec263ee
comparison
equal deleted inserted replaced
1064:cc17de34c689 1065:7fa853864d9b
54 tmp = parseFloat(valueString).toExponential(); 54 tmp = parseFloat(valueString).toExponential();
55 } 55 }
56 var parts = tmp.split('e'); 56 var parts = tmp.split('e');
57 if (parts[0].indexOf('.') > 0) { 57 if (parts[0].indexOf('.') > 0) {
58 var floatPart = parseFloat(parts[0]); 58 var floatPart = parseFloat(parts[0]);
59 parts[0] = floatPart.toLocaleString(); 59 var separator = floatPart.toLocaleString().replace(/[-\d]/g, '');
60 parts[0] = floatPart.toFixed(3).replace('.', separator);
60 } 61 }
61 return parts[0] + 'e' + parts[1]; 62 return parts[0] + 'e' + parts[1];
62 } 63 }
63 }, { 64 }, {
64 name: 'messwertPzs', 65 name: 'messwertPzs',
89 tmp = parseFloat(valueString).toExponential(); 90 tmp = parseFloat(valueString).toExponential();
90 } 91 }
91 var parts = tmp.split('e'); 92 var parts = tmp.split('e');
92 if (parts[0].indexOf('.') > 0) { 93 if (parts[0].indexOf('.') > 0) {
93 var floatPart = parseFloat(parts[0]); 94 var floatPart = parseFloat(parts[0]);
94 parts[0] = floatPart.toLocaleString(); 95 var separator = floatPart.toLocaleString().replace(/[-\d]/g, '');
96 parts[0] = floatPart.toFixed(3).replace('.', separator);
95 } 97 }
96 return parts[0] + 'e' + parts[1]; 98 return parts[0] + 'e' + parts[1];
97 } 99 }
98 }, { 100 }, {
99 name: 'messfehler', 101 name: 'messfehler',

http://lada.wald.intevation.org