fable 3.0.82 → 3.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fable.compatible.js +2 -2
- package/dist/fable.compatible.min.js +1 -1
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +2 -2
- package/dist/fable.min.js +1 -1
- package/dist/fable.min.js.map +1 -1
- package/package.json +1 -1
- package/source/services/Fable-Service-DataFormat.js +10 -0
- package/test/DataFormat-StringNumberFormatting_tests.js +6 -0
package/package.json
CHANGED
|
@@ -261,6 +261,11 @@ class DataFormat extends libFableServiceProviderBase
|
|
|
261
261
|
return this._Value_NaN_Currency;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
if (pValue === null || pValue === undefined)
|
|
265
|
+
{
|
|
266
|
+
return this._Value_NaN_Currency;
|
|
267
|
+
}
|
|
268
|
+
|
|
264
269
|
let tmpDollarAmountArbitrary = this.fable.Utility.bigNumber(pValue);
|
|
265
270
|
let tmpDollarAmount = tmpDollarAmountArbitrary.toFixed(2);
|
|
266
271
|
|
|
@@ -300,6 +305,11 @@ class DataFormat extends libFableServiceProviderBase
|
|
|
300
305
|
return tmpZed.toFixed(tmpDigits);
|
|
301
306
|
}
|
|
302
307
|
|
|
308
|
+
if (pValue === null || pValue === undefined)
|
|
309
|
+
{
|
|
310
|
+
return '';
|
|
311
|
+
}
|
|
312
|
+
|
|
303
313
|
let tmpAmountArbitrary = this.fable.Utility.bigNumber(pValue);
|
|
304
314
|
let tmpValue = tmpAmountArbitrary.toFixed(tmpDigits);
|
|
305
315
|
|
|
@@ -88,6 +88,9 @@ suite
|
|
|
88
88
|
Expect(_DataFormat
|
|
89
89
|
.formatterDollars(10000))
|
|
90
90
|
.to.equal('$10,000.00');
|
|
91
|
+
Expect(_DataFormat
|
|
92
|
+
.formatterDollars(null))
|
|
93
|
+
.to.equal('--');
|
|
91
94
|
Expect(_DataFormat
|
|
92
95
|
.formatterDollars(-8675309.75))
|
|
93
96
|
.to.equal('$-8,675,309.75');
|
|
@@ -110,6 +113,9 @@ suite
|
|
|
110
113
|
Expect(_DataFormat
|
|
111
114
|
.formatterRoundNumber(1000, 2))
|
|
112
115
|
.to.equal('1000.00');
|
|
116
|
+
Expect(_DataFormat
|
|
117
|
+
.formatterRoundNumber(null, 2))
|
|
118
|
+
.to.equal('');
|
|
113
119
|
Expect(_DataFormat
|
|
114
120
|
.formatterRoundNumber(1000.129, 2))
|
|
115
121
|
.to.equal('1000.13');
|