Name: numeric
Category: Utils
Description:
Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.
Syntax:
numeric(x)
Examples:
numeric("4")
4
numeric("4", "number")
4
numeric("4", "bigint")
4
numeric("4", "BigNumber")
4
numeric("4", "Fraction")
4/1
numeric(4, "Fraction")
4/1
numeric(fraction(2, 5), "number")
0.4
See also: number, bigint, fraction, bignumber, string, format