comparison app/model/Messwert.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
57 tmp = parseFloat(valueString).toExponential(); 57 tmp = parseFloat(valueString).toExponential();
58 } 58 }
59 var parts = tmp.split('e'); 59 var parts = tmp.split('e');
60 if (parts[0].indexOf('.') > 0) { 60 if (parts[0].indexOf('.') > 0) {
61 var floatPart = parseFloat(parts[0]); 61 var floatPart = parseFloat(parts[0]);
62 parts[0] = floatPart.toLocaleString(); 62 var separator = floatPart.toLocaleString().replace(/[-\d]/g, '');
63 parts[0] = floatPart.toFixed(3).replace('.', separator);
63 } 64 }
64 return parts[0] + 'e' + parts[1]; 65 return parts[0] + 'e' + parts[1];
65 } 66 }
66 }, { 67 }, {
67 name: 'messwertNwg', 68 name: 'messwertNwg',

http://lada.wald.intevation.org