diff 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
line wrap: on
line diff
--- a/app/model/Messwert.js	Wed Mar 09 16:27:58 2016 +0100
+++ b/app/model/Messwert.js	Thu Mar 10 10:45:50 2016 +0100
@@ -59,7 +59,8 @@
             var parts = tmp.split('e');
             if (parts[0].indexOf('.') > 0) {
                 var floatPart = parseFloat(parts[0]);
-                parts[0] = floatPart.toLocaleString();
+                var separator = floatPart.toLocaleString().replace(/[-\d]/g, '');
+                parts[0] = floatPart.toFixed(3).replace('.', separator);
             }
             return parts[0] + 'e' + parts[1];
         }

http://lada.wald.intevation.org