mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-13 11:58:58 +00:00
faster conversion to string for ripple
This commit is contained in:
parent
cc5d7a9b66
commit
83abbd9ac3
@ -237,7 +237,7 @@ export const feeValidation = ($state: State): PayloadAction<State> => (dispatch:
|
||||
|
||||
const calculateTotal = (amount: string, fee: string): string => {
|
||||
try {
|
||||
return new BigNumber(amount).plus(fee).toString(10);
|
||||
return new BigNumber(amount).plus(fee).toFixed();
|
||||
} catch (error) {
|
||||
return '0';
|
||||
}
|
||||
@ -248,7 +248,7 @@ const calculateMaxAmount = (balance: BigNumber, fee: string): string => {
|
||||
// TODO - minus pendings
|
||||
const max = balance.minus(fee);
|
||||
if (max.lessThan(0)) return '0';
|
||||
return max.toString(10);
|
||||
return max.toFixed();
|
||||
} catch (error) {
|
||||
return '0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user