std.string.format

Don Clugston dac at nospam.com.au
Tue Dec 26 06:52:28 PST 2006


Egor Starostin wrote:
> 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"

This sounds like a C library issue. Are you using GDC, or DMD ?
> 
> What can I do with the second problem? Can anyone suggest a
> workaround?



More information about the Digitalmars-d mailing list