@kizmann/pico-js 0.3.16 → 0.3.17
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +1 -1
- package/src/utility/number.js +5 -1
package/package.json
CHANGED
package/src/utility/number.js
CHANGED
@@ -91,6 +91,10 @@ export class Num
|
|
91
91
|
|
92
92
|
static format(num, decimal = '.', thousand = ',', fixed = null)
|
93
93
|
{
|
94
|
+
if ( num === null ) {
|
95
|
+
return null;
|
96
|
+
}
|
97
|
+
|
94
98
|
let value = num.toString();
|
95
99
|
|
96
100
|
if ( fixed !== null && fixed !== - 1 ) {
|
@@ -98,7 +102,7 @@ export class Num
|
|
98
102
|
}
|
99
103
|
|
100
104
|
let totals = value.replace(/\.[0-9]+$/, ''),
|
101
|
-
minals = value.replace(/^[0-9]+\./, '');
|
105
|
+
minals = value.replace(/^[0-9\-]+\./, '');
|
102
106
|
|
103
107
|
let splits = Arr.reduce(totals.split('').reverse(), (result, val, key) => {
|
104
108
|
|