fix(trading): update step on market dp (#2972)

This commit is contained in:
m.ray 2023-02-23 06:10:56 -05:00 committed by GitHub
parent e4bf61c2e2
commit d95fdca0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,9 @@ const MIN_FRACTION_DIGITS = 2;
const MAX_FRACTION_DIGITS = 20;
export function toDecimal(numberOfDecimals: number) {
return 1 / Math.pow(10, numberOfDecimals);
return new BigNumber(1)
.dividedBy(Math.pow(10, numberOfDecimals))
.toString(10);
}
export function toBigNum(

View File

@ -1,6 +1,6 @@
import { t } from '../i18n';
export const validateAmount = (step: number, field: string) => {
export const validateAmount = (step: number | string, field: string) => {
const [, stepDecimals = ''] = String(step).split('.');
return (value: string) => {