Skip to content

Commit

Permalink
Fixed floor, ceiling and round for FixedNumber for non-default Formats (
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 22, 2021
1 parent 0f0d0c0 commit 551cfa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/bignumber/src.ts/fixednumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class FixedNumber {

const hasFraction = !comps[1].match(/^(0*)$/);
if (this.isNegative() && hasFraction) {
result = result.subUnsafe(ONE);
result = result.subUnsafe(ONE.toFormat(result.format));
}

return result;
Expand All @@ -268,7 +268,7 @@ export class FixedNumber {

const hasFraction = !comps[1].match(/^(0*)$/);
if (!this.isNegative() && hasFraction) {
result = result.addUnsafe(ONE);
result = result.addUnsafe(ONE.toFormat(result.format));
}

return result;
Expand Down

0 comments on commit 551cfa0

Please sign in to comment.