changeset 1100:250e51e72155

merged.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 May 2016 16:02:31 +0200
parents 7a71723fda83 (current diff) 7c0bc1146796 (diff)
children 421db8840f49 05948135ce75
files
diffstat 2 files changed, 36 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Messwert.js	Tue May 10 16:01:59 2016 +0200
+++ b/app/model/Messwert.js	Tue May 10 16:02:31 2016 +0200
@@ -42,11 +42,37 @@
                 return value;
             }
             var valueString = value.toString();
-            if (valueString.indexOf(',') > 0) {
-                valueString.replace(',', '.');
+            if (valueString.indexOf('E') > 0) {
+                valueString = valueString.replace('E', 'e');
             }
-            return parseFloat(valueString).toExponential(2).toString()
-                .replace('.', ',');
+            var tmp;
+            if (valueString.indexOf('e') > 0) {
+                tmp = valueString;
+            }
+            else {
+                // Currently not locale friendly...
+                if (valueString.indexOf(',') > 0) {
+                    valueString = valueString.replace(',', '.');
+                }
+                tmp = parseFloat(valueString).toExponential();
+            }
+            var parts = tmp.split('e');
+            if (parts[0].indexOf('.') > 0) {
+                var floatPart = parseFloat(parts[0]);
+                var separator = floatPart.toFixed(2).toLocaleString().replace(/[-\d]/g, '');
+                parts[0] = floatPart.toFixed(2).replace('.', separator);
+            }
+            else if (parts[0].indexOf(',') < 0) {
+                parts[0] = parts[0] + ',00';
+            }
+            var intPart = parseInt(parts[1]);
+            if (intPart < 10 && intPart >= 0) {
+                parts[1] = '+0' + parseInt(parts[1]);
+            }
+            else if (intPart < 0 && intPart > -10) {
+                parts[1] = parts[1].replace('-', '-0');
+            }
+            return parts[0] + 'e' + parts[1];
         }
     }, {
         name: 'messwertNwg',
--- a/install-dependencies.sh	Tue May 10 16:01:59 2016 +0200
+++ b/install-dependencies.sh	Tue May 10 16:02:31 2016 +0200
@@ -6,7 +6,7 @@
 cd $SCRIPT_DIR
 curl -O https://cdn.sencha.com/ext/gpl/ext-4.2.1-gpl.zip
 unzip -n ext-4.2.1-gpl.zip
-ln -s ext-4.2.1.883 extjs
+ln -sf ext-4.2.1.883 extjs
 
 mkdir -p resources/lib/ext
 cd resources/lib
@@ -14,17 +14,17 @@
 curl -L https://github.com/eligrey/FileSaver.js/archive/master.zip \
      -o FileSaver-js.zip
 unzip -n FileSaver-js.zip
-ln -s FileSaver.js-master FileSaver
+ln -sf FileSaver.js-master FileSaver
 
 curl -L https://github.com/eligrey/Blob.js/archive/master.zip \
      -o Blob-js.zip
 unzip -n Blob-js.zip
-ln -s Blob.js-master Blob
+ln -sf Blob.js-master Blob
 
 curl -L https://github.com/openlayers/openlayers/archive/release-2.13.1.zip \
      -o OpenLayers-2-13-1.zip
 unzip -n OpenLayers-2-13-1.zip
-ln -s openlayers-release-2.13.1/build OpenLayers
+ln -sf ol2-release-2.13.1/build OpenLayers
 cd OpenLayers
 python build.py
 
@@ -32,11 +32,11 @@
 curl -L https://github.com/elmasse/Ext.i18n.Bundle/archive/v0.3.3.zip \
      -o Ext-i18n-Bundle-v0-3-3.zip
 unzip -n Ext-i18n-Bundle-v0-3-3.zip
-ln -s Ext.i18n.Bundle-0.3.3/i18n i18n
+ln -sf elmasse-bundle-0.3.3/i18n i18n
 
 curl -L https://github.com/ivan-novakov/extjs-upload-widget/archive/1.1.1.zip \
      -o Ext-ux-Upload-1-1-1.zip
 unzip -n Ext-ux-Upload-1-1-1.zip
-ln -s extjs-upload-widget-1.1.1/lib/upload upload
+ln -sf extjs-upload-widget-1.1.1/lib/upload upload
 
 cd $CUR_DIR

http://lada.wald.intevation.org