Module Number.Prototype

Number.prototype methods

val to_string : ?options:options -> float -> string

to_string ?options n converts number n to string with JS-compatible formatting. Equivalent to JavaScript's Number.prototype.toString().

val to_fixed : int -> float -> string

to_fixed digits n formats n with digits fractional digits. Equivalent to JavaScript's Number.prototype.toFixed().

val to_precision : int -> float -> string

to_precision digits n formats n with digits significant digits. Equivalent to JavaScript's Number.prototype.toPrecision().

val to_exponential : int -> float -> string

to_exponential digits n formats n in exponential notation. Equivalent to JavaScript's Number.prototype.toExponential().

val to_radix : int -> float -> string

to_radix radix n formats n in the given radix (2-36). Equivalent to JavaScript's Number.prototype.toString(radix).