Selaa lähdekoodia

Rounds floats passed to analytics (instead of truncating them).

j8
Boris Grozev 9 vuotta sitten
vanhempi
commit
c59d9e7c8b
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1
    1
      analytics.js

+ 1
- 1
analytics.js Näytä tiedosto

12
 
12
 
13
   Analytics.prototype.sendEvent = function (action, data) {
13
   Analytics.prototype.sendEvent = function (action, data) {
14
     // empty label and add the value, the value should be integer or null
14
     // empty label and add the value, the value should be integer or null
15
-    var value = parseInt(data);
15
+    var value = Math.round(parseFloat(data));
16
 
16
 
17
     ga('send', 'event', 'jit.si', action, "", value ? value : null);
17
     ga('send', 'event', 'jit.si', action, "", value ? value : null);
18
   };
18
   };

Loading…
Peruuta
Tallenna