Compare commits

...
2 changed files with 4 additions and 2 deletions
+3 -1
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(
@@ -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) => {