Commit 04097cb485aee4d19868b705c61c0ca8ec458f56
1 parent
c5fa9cdb
truncate 2 decimal
Showing
1 changed file
with
6 additions
and
1 deletions
datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
... | ... | @@ -210,7 +210,12 @@ var AjaxJsonAlasqlBehavior = { |
210 | 210 | var data = []; |
211 | 211 | |
212 | 212 | for (var i in obj) { |
213 | - data.push(obj[i][name]); | |
213 | + var v = obj[i][name]; | |
214 | + if(!isNaN(v) && v % 1 != 0) | |
215 | + v = Math.floor(v * 100) / 100; | |
216 | + data.push(v); | |
217 | + | |
218 | + //data.push(obj[i][name]); | |
214 | 219 | } |
215 | 220 | |
216 | 221 | this.data.push({ | ... | ... |