std.string.format

Egor Starostin egorst at gmail.com
Tue Dec 26 06:29:51 PST 2006


I have a couple of issues with std.string.format.

1. why
writefln(format("%%1.%df",2));
produces 'Error: std.format'
but
writefln(format(format("%%1.%df",2),1.0));
works fine?

2. on Windows:
format(format("%%1.%df",4),666666/1000000.0) produces "0.6667"
but
format(format("%%1.%df",4),66666/1000000.0) produces "0.0666"

on Linux second line gives correct answer "0.0667"

What can I do with the second problem? Can anyone suggest a
workaround?



More information about the Digitalmars-d mailing list