The value to create the Big instance from.
Creates a new Big instance from the given value. If the value is already a Big instance, it returns the value itself. Use this function instead of the Big constructor to create a Big instance from a value.
The value to create the Big instance from. It Can be a number, string, or BigInt.
Creates a new Big instance from the given value. If the value is already a Big instance, it returns the value itself. Use this function instead of the Big constructor to create a Big instance from a value.
The value to create the Big instance from. Can be a number, string, or BigInt.
Optional
scale: string | numberThe scale for the value (optional), representing the number of decimal places. If scale provided and value has a fractional part, the fractional part will be removed.
const big1 = createBig(123.456); // 123.456
const big2 = createBig("123.456"); // 123.456
const big3 = createBig(123.456, 2); // 1.23, because the scale is 2 and it removes the fractional part
Generated using TypeDoc
Creates a new Big instance from the given value. If the value is already a Big instance, it returns the value itself. Use this function instead of the Big constructor to create a Big instance from a value.