Decimal.toString

Converts current value to string, passing it to the given sink using the specified format.

  1. void toString(void delegate(const(C)[]) sink, FormatSpec!C fmt)
    struct Decimal(int bits)
    version(!D_BetterC)
    const
    @IEEECompliant("convertToDecimalCharacter", 22)
    @IEEECompliant("convertToHexCharacter", 22)
    void
    toString
    (
    C
    )
    (
    scope void delegate
    (
    const(C)[]
    )
    sink
    ,
    FormatSpec!C fmt
    )
    if (
    isSomeChar!C
    )
    if (
    bits == 32 ||
    bits == 64
    ||
    bits == 128
    )
  2. void toString(void delegate(const(C)[]) sink)
  3. string toString()
  4. string toString(FormatSpec!C fmt)
  5. string toString(const(C)[] fmt)

Parameters

sink void delegate
(
const(C)[]
)

a delegate used to sink character arrays;

fmt FormatSpec!C

a format specification; Notes: This function is not intended to be used directly, it is used by the format, output or conversion family of functions from Phobos. All standard format options are supported, except digit grouping.

Supported formats

  • f, F - floating point notation
  • e, E - scientific notation
  • a, A - hexadecimal floating point notation
  • g, G - shortest representation between floating point and scientific notation
  • s, S - same as g, G

Throws

$(PHOBOS format, FormatException, FormatException) if the format specifier is not supported

See Also

$(PHOBOS format, FormatSpec, FormatSpec) $(PHOBOS format, format, format) $(PHOBOS conv, to, to) $(PHOBOS stdio, writef, writef) $(PHOBOS stdio, writefln, writefln)

Meta