std.format and floating point issue

Ali Çehreli acehreli at yahoo.com
Wed Nov 1 19:06:42 UTC 2017


On 10/29/2017 03:13 AM, codephantom wrote:
> Can anyone help me to understand why the format in the second writeln 
> below, does not format the output with commas?
> 
> --------------------------------
> 
> void main()
> {
>      import std.stdio, std.format;
> 
>      writeln( format("%,.1f", 84543432.951172) ); // 84,543,433.0
>      writeln( format("%,.0f", 84543432.951172) ); // 84543433
> 
> }
> 
> ------------------------------

Thanks for letting me know about this new feature. :) I agree with you 
that it's a bug.

Ali


More information about the Digitalmars-d-learn mailing list