format

Format a floating-point value according to a format string

Defaults to 2 decimal places and 10 exponent, as the other format overload does.

Format specifiers (additive unless stated otherwise): '.' = Do not pad 'e' or 'E' = Display exponential notation Any number = Set the decimal precision

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

Parameters

T

character type

V

Floating point type

output T[]

Where to write the string to - expected to be large enough

v V

Number to format

fmt T[]

Format string, see this function's description

Return Value

Type: const(T)[]

A const reference to output

Meta