[TASK] Replace numeraljs with toFixed vanilla js

This commit is contained in:
Xaver Maierhofer 2016-05-25 23:38:18 +02:00 committed by Milan Pässler
commit 90d2c3e444
7 changed files with 15 additions and 26 deletions

View file

@ -1,5 +1,5 @@
define(["moment", "numeral", "tablesort", "tablesort.number", "moment.de"],
function (moment, numeral, Tablesort) {
define(["moment", "tablesort", "tablesort.number", "moment.de"],
function (moment, Tablesort) {
function showGeoURI(d) {
function showLatitude(d) {
var suffix = Math.sign(d) > -1 ? "'N" : "'S";
@ -8,7 +8,7 @@ define(["moment", "numeral", "tablesort", "tablesort.number", "moment.de"],
var min = (d * 60) % 60;
a = (a < 10 ? "0" : "") + a;
return a + "° " + numeral(min).format("0.000") + suffix;
return a + "° " + min.toFixed(3) + suffix;
}
function showLongitude(d) {
@ -18,7 +18,7 @@ define(["moment", "numeral", "tablesort", "tablesort.number", "moment.de"],
var min = (d * 60) % 60;
a = (a < 100 ? "0" + (a < 10 ? "0" : "") : "") + a;
return a + "° " + numeral(min).format("0.000") + suffix;
return a + "° " + min.toFixed(3) + suffix;
}
if (!has_location(d)) {
@ -297,7 +297,7 @@ define(["moment", "numeral", "tablesort", "tablesort.number", "moment.de"],
}
return function (el) {
el.appendChild(showLoadBar("load-avg", numeral(d.statistics.loadavg).format("0.00")));
el.appendChild(showLoadBar("load-avg", d.statistics.loadavg.toFixed(2)));
};
}