Replacement for snprintf

berni44 dlang at d-ecke.de
Mon Nov 4 12:59:33 UTC 2019


On Saturday, 2 November 2019 at 16:59:15 UTC, Jacob Carlborg 
wrote:
> On 2019-11-01 18:02, H. S. Teoh wrote:
>
>> That would be a better solution. It would be different from 
>> snprintf,
>> though, and we'd have to document it well so that people can 
>> find it.
>
> It depends on what the goal is. If it is to have 100% 
> compatible drop-in replacement to snprintf then we need to 
> include the localization.
>
> But if the goal is just to have a function that converts values 
> to a string, which is implemented in D, then have the 
> opportunity to make a better interface.

+1

That's actually, what I ask myself all the time. I personally 
prefer the second approach.

And a similar question arrises with the rounding problem, which 
is even a little bit more difficult, because the IEEE standard 
interferes here too.


More information about the Digitalmars-d mailing list