Decimal.toString

  1. immutable(C)[] toString(NumericSpec spec)
  2. void toString(W w, NumericSpec spec)
    struct Decimal(size_t maxSize64)
    const
    void
    toString
    (
    C = char
    W
    )
    if (
    isSomeChar!C &&
    isMutable!C
    )
    if (
    maxSize64 &&
    maxSize64 <= ushort.max
    )

Examples

Check @nogc toString impl

import mir.format: stringBuf;
auto str = "5.28238923728e-876543210";
auto decimal = Decimal!1(str);
stringBuf buffer;
buffer << decimal;
assert(buffer.data == str, buffer.data);

Meta