Decimal.toString

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

Examples

auto str = "-3.4010447314490204552169750449563978034784726557588085989975288830070948234680e-13245";
auto decimal = Decimal!4(str);
assert(decimal.toString == str, decimal.toString);

decimal = Decimal!4.init;
assert(decimal.toString == "0.0");

Meta