Module Core_kernel__.Percent.Format

A Format.t tells Percent.format how to render a floating-point value as a string. Many of the Format.t values correspond to printf conversion specifications. For example:


      format (Format.exponent ~precision) = sprintf "%.e" precision
    

The _E naming suffix in Format values is mnenomic of a capital E (rather than e) being used in floating-point exponent notation.

Here is the documentation of the floating-point conversion specifications from the OCaml manual:

type t
include sig ... end
val sexp_of_t : t ‑> Sexplib.Sexp.t
val exponent : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*e" precision

val exponent_E : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*E" precision

val decimal : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*f" precision

val ocaml : t

sprintf "%F"

val compact : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*g" precision

val compact_E : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*G" precision

val hex : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*h" precision

val hex_E : precision:Core_kernel__.Import.int ‑> t

sprintf "%.*H" precision