mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 09:23:21 +01:00
Fix for error during sending to multisig address (#17651)
This commit is contained in:
parent
10be6fcfeb
commit
6b64572f8d
@ -537,5 +537,29 @@ describe('Numeric', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('round', () => {
|
||||
it('should return number rounded', () => {
|
||||
expect(new Numeric(10.4375, 10).round()).toEqual(
|
||||
new Numeric(10.4375, 10),
|
||||
);
|
||||
expect(new Numeric(10.4375, 10).round(0)).toEqual(new Numeric(10, 10));
|
||||
expect(new Numeric(10.4375, 10).round(1)).toEqual(
|
||||
new Numeric(10.4, 10),
|
||||
);
|
||||
expect(new Numeric(10.4375, 10).round(2)).toEqual(
|
||||
new Numeric(10.44, 10),
|
||||
);
|
||||
expect(new Numeric(10.4375, 10).round(3)).toEqual(
|
||||
new Numeric(10.437, 10),
|
||||
);
|
||||
expect(new Numeric(10.4375, 10).round(4)).toEqual(
|
||||
new Numeric(10.4375, 10),
|
||||
);
|
||||
expect(new Numeric(10.4375, 10).round(5)).toEqual(
|
||||
new Numeric(10.4375, 10),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -434,7 +434,7 @@ export class Numeric {
|
||||
numberOfDecimals?: number,
|
||||
roundingMode: number = BigNumber.ROUND_HALF_DOWN,
|
||||
) {
|
||||
if (numberOfDecimals) {
|
||||
if (typeof numberOfDecimals === 'number') {
|
||||
return new Numeric(
|
||||
this.value.round(numberOfDecimals, roundingMode),
|
||||
this.base,
|
||||
|
Loading…
Reference in New Issue
Block a user