mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-01 03:40:53 +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 => {
|
const calculateTotal = (amount: string, fee: string): string => {
|
||||||
try {
|
try {
|
||||||
return new BigNumber(amount).plus(fee).toString(10);
|
return new BigNumber(amount).plus(fee).toFixed();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ const calculateMaxAmount = (balance: BigNumber, fee: string): string => {
|
|||||||
// TODO - minus pendings
|
// TODO - minus pendings
|
||||||
const max = balance.minus(fee);
|
const max = balance.minus(fee);
|
||||||
if (max.lessThan(0)) return '0';
|
if (max.lessThan(0)) return '0';
|
||||||
return max.toString(10);
|
return max.toFixed();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user