Substitutions with writef() or format()?

Ron Tarrant rontarrant at gmail.com
Sun Jul 14 13:45:38 UTC 2019


'Morning, all.

If these lines:

    string currency = format("$%,.02f", 11_234_456.99);
    writeln(currency);

Will result in:

    $11,234,456.99

Why don't these lines:

    string notCurrency = format("%,", 11_234_456);
    writeln(notCurrency);

result in:

    11,234,456

???

Instead of a range violation?




More information about the Digitalmars-d-learn mailing list