← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21779: Now preserving decimals for tracked entity attributes

 

------------------------------------------------------------
revno: 21779
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-18 17:18:07 +0100
message:
  Now preserving decimals for tracked entity attributes
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2016-01-11 11:26:33 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2016-01-18 16:18:07 +0000
@@ -945,15 +945,20 @@
                 }                
             }
             else{
-                if(val){                    
-                    if( type === 'NUMBER' ){
-                        if(dhis2.validation.isNumber(val)){                            
-                            //val = new Number(val);
-                            val = parseInt(val);                            
-                        }
-                        else{
-                            //val = new Number('0');
-                            val = parseInt('0');      
+                if(val){  
+                    if(type === 'NUMBER' ||
+                        type === 'INTEGER' ||
+                        type === 'INTEGER_POSITIVE' ||
+                        type === 'INTEGER_NEGATIVE' ||
+                        type === 'INTEGER_ZERO_OR_POSITIVE'){
+                        if( dhis2.validation.isNumber(val)){
+                            if(type === 'NUMBER'){
+                                val = parseFloat(val);
+                            }else{
+                                val = parseInt(val);
+                            }
+                        } else {
+                            val = parseInt('0');
                         }
                     }
                     if(type === 'DATE'){