@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -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