@medialane/sdk 0.99.0 → 0.99.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/dist/index.cjs CHANGED
@@ -1213,8 +1213,8 @@ function formatAmount(raw, decimals) {
1213
1213
  const factor = 10n ** BigInt(decimals);
1214
1214
  const whole = value / factor;
1215
1215
  const remainder = value % factor;
1216
- const fractional = remainder.toString().padStart(decimals, "0");
1217
- return `${whole}.${fractional}`;
1216
+ const fractional = remainder.toString().padStart(decimals, "0").replace(/0+$/, "");
1217
+ return fractional ? `${whole}.${fractional}` : whole.toString();
1218
1218
  }
1219
1219
  function getTokenByAddress(address) {
1220
1220
  let target = null;