Skip to content

Commit

Permalink
fix(format): fixed digits formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 17, 2022
1 parent a9f5a41 commit f43ef24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ BigNumber.prototype.format = function (decimals?: number, digits?: number) {
digits ??= decimals;

return digits < decimals
? formatted.slice(0, dotIndex + decimals - digits)
? formatted.slice(0, dotIndex + 1 + digits)
: formatted + "0".repeat(digits - decimals);
};
BigNumber.prototype.toFloat = function (decimals?: number) {
Expand Down

0 comments on commit f43ef24

Please sign in to comment.