Is Anything Holding you back?

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 6 07:45:35 PDT 2015


On Tuesday, 6 October 2015 at 13:31:25 UTC, krzaq wrote:
> For example: you can't rely on Clock.currTime.toString() (or 
> ISO string overloads) to provide a reliable fixed-length 
> representation for logging purposes and the class mysteriously 
> lacks any kind of .format() function that's available pretty 
> much everywhere else.

The ISO standard doesn't really say what to do with the number of 
decimal places, and it's usually cleanest to not have a bunch of 
trailing zeroes, which is why the to*String functions are the way 
they are. I was thinking about adding a way to tell it the number 
of digits though, since std.experimental.logger had to deal with 
that. It's not something that's generally come up though. I 
really should have gotten the custom formatting done before now, 
but it is on the todo list. For most stuff though, it's best to 
just use toISOExtString, since it's a standard format and quite 
legible (unlike straight ISO - I don't know why they even have 
the ISO format in addition to the extended ISO format; it's 
pretty much impossible to read).

- Jonathan M Davis


More information about the Digitalmars-d mailing list