wenay-common 1.0.135 → 1.0.136
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/lib/Common/common.js +3 -2
- package/package.json +1 -1
package/lib/Common/common.js
CHANGED
|
@@ -386,7 +386,7 @@ function NormalizeDoubleAnd(a, options) {
|
|
|
386
386
|
return a;
|
|
387
387
|
if (r)
|
|
388
388
|
w = r;
|
|
389
|
-
let k = Math.ceil(Math.log10(a));
|
|
389
|
+
let k = Math.ceil(Math.log10(Math.abs(a)));
|
|
390
390
|
const func = options?.type == "max" ? Math.ceil : options?.type == "min" ? Math.floor : Math.round;
|
|
391
391
|
if (k > w && !r)
|
|
392
392
|
return func(a);
|
|
@@ -401,7 +401,8 @@ function DblToStrAnd(a, options) {
|
|
|
401
401
|
return a.toString();
|
|
402
402
|
if (r)
|
|
403
403
|
w = r;
|
|
404
|
-
|
|
404
|
+
let a2 = Math.abs(a);
|
|
405
|
+
const k = Math.floor(Math.log10(a2));
|
|
405
406
|
const func = options?.type == "max" ? Math.ceil : options?.type == "min" ? Math.floor : Math.round;
|
|
406
407
|
if (k + 1 >= w && !r)
|
|
407
408
|
return func(a).toString();
|