@dune2/tools 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dune2/tools",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "i18n"
@@ -273,10 +273,13 @@ export class Numbro {
273
273
  }
274
274
 
275
275
  if (shouldDeleteEndZero) {
276
- // 移除尾数 0
277
- // outputFormat = outputFormat.replace(/\.?0+$/, "");
278
- const reg = new RegExp(`\\.?0+${suffix}$`);
279
- outputFormat = outputFormat.replace(reg, suffix);
276
+ const isDecimal = outputFormat.includes(".");
277
+ if (isDecimal) {
278
+ // 移除尾数 0
279
+ // outputFormat = outputFormat.replace(/\.?0+$/, "");
280
+ const reg = new RegExp(`\\.?0+${suffix}$`);
281
+ outputFormat = outputFormat.replace(reg, suffix);
282
+ }
280
283
  }
281
284
  return outputFormat;
282
285
  }