format

Convert a floating-point number to a string.

The e parameter controls the number of exponent places emitted, and can thus control where the output switches to the scientific notation. For example, setting e=2 for 0.01 or 10.0 would result in normal output. Whereas setting e=1 would result in both those values being rendered in scientific notation instead. Setting e to 0 forces that notation on for everything. Parameter pad will append trailing '0' decimals when set ~ otherwise trailing '0's will be elided

  1. const(T)[] format(T[] output, V v, T[] fmt)
  2. T[] format(T[] dst, NumType x, int decimals, int e, bool pad)
    T[]
    format
    (
    T
    )
    (
    T[] dst
    ,
    NumType x
    ,
    int decimals = Dec
    ,
    int e = Exp
    ,
    bool pad = Pad
    )

Meta