|
@@ -172,14 +172,16 @@ const Withdraw = () => {
|
|
|
max?: number;
|
|
|
length?: number;
|
|
|
notNumber?: boolean;
|
|
|
+ fixed?: number;
|
|
|
}
|
|
|
) => {
|
|
|
const toValue = value.replace(/[^0-9]/gi, "");
|
|
|
let toAmount = "";
|
|
|
+ let toFixedNum = opts?.fixed ? opts?.fixed : 0;
|
|
|
if (toValue && !opts?.notNumber) {
|
|
|
- toAmount = new BigNumber(toValue).toFixed(0, BigNumber.ROUND_DOWN);
|
|
|
+ toAmount = new BigNumber(toValue).toFixed(toFixedNum, BigNumber.ROUND_DOWN);
|
|
|
if (opts?.max !== undefined && new BigNumber(toAmount).isGreaterThan(opts.max)) {
|
|
|
- toAmount = opts.max.toString();
|
|
|
+ toAmount = new BigNumber(opts.max).toFixed(toFixedNum, BigNumber.ROUND_DOWN);
|
|
|
}
|
|
|
}
|
|
|
if (toValue && opts?.notNumber) {
|