@totemsdk/core 1.2.7 → 1.2.8
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/MiniNumber.js +9 -1
- package/dist/cjs/MiniNumber.js +9 -1
- package/package.json +1 -1
package/dist/MiniNumber.js
CHANGED
|
@@ -128,7 +128,15 @@ export class MiniNumber {
|
|
|
128
128
|
else {
|
|
129
129
|
s = s.slice(0, s.length - this.scale) + '.' + s.slice(s.length - this.scale);
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
const dotIdx = s.indexOf('.');
|
|
132
|
+
if (dotIdx !== -1) {
|
|
133
|
+
let end = s.length;
|
|
134
|
+
while (end > dotIdx + 1 && s[end - 1] === '0')
|
|
135
|
+
end -= 1;
|
|
136
|
+
if (end === dotIdx + 1)
|
|
137
|
+
end = dotIdx;
|
|
138
|
+
s = s.slice(0, end);
|
|
139
|
+
}
|
|
132
140
|
return neg ? '-' + s : s;
|
|
133
141
|
}
|
|
134
142
|
assertSameScale(other) {
|
package/dist/cjs/MiniNumber.js
CHANGED
|
@@ -131,7 +131,15 @@ class MiniNumber {
|
|
|
131
131
|
else {
|
|
132
132
|
s = s.slice(0, s.length - this.scale) + '.' + s.slice(s.length - this.scale);
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
const dotIdx = s.indexOf('.');
|
|
135
|
+
if (dotIdx !== -1) {
|
|
136
|
+
let end = s.length;
|
|
137
|
+
while (end > dotIdx + 1 && s[end - 1] === '0')
|
|
138
|
+
end -= 1;
|
|
139
|
+
if (end === dotIdx + 1)
|
|
140
|
+
end = dotIdx;
|
|
141
|
+
s = s.slice(0, end);
|
|
142
|
+
}
|
|
135
143
|
return neg ? '-' + s : s;
|
|
136
144
|
}
|
|
137
145
|
assertSameScale(other) {
|