Merge pull request #711 from rockstardev/bugfix/satround

Javascript floating point math fix, closes #701
This commit is contained in:
Nicolas Dorier 2019-03-24 13:35:13 +09:00 committed by GitHub
commit 563882d30b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,8 @@ function onDataCallback(jsonData) {
}
function numberFormatted(x) {
var parts = x.toString().split(".");
var rounded = Math.round(x);
var parts = rounded.toString().split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
return parts.join(".");
}