@yoroi/common
Version:
The Common package of Yoroi SDK
21 lines • 767 B
TypeScript
import { Numbers } from '@yoroi/types';
import { BigNumber } from 'bignumber.js';
/**
* Parses a decimal number from a string and returns the parsed value as a BigNumber.
*
* @param value - The string to parse, negative sign is ignored.
* @param decimalPlaces - The number of decimal places to round (BigNumber.ROUND_DOWN).
* @param format - The locale format to use for formatting the parsed value.
*
* @returns An object containing the string and the parsed value as a BigNumber.
*/
export declare function parseDecimal({ value, decimalPlaces, format, }: {
value: string | number | BigNumber;
decimalPlaces: number;
format: Numbers.Locale;
}): {
text: string;
bn: BigNumber;
bi: bigint;
};
//# sourceMappingURL=parse-decimal.d.ts.map