Poll on improved format strings.

janderson askme at me.com
Wed Mar 7 09:26:31 PST 2007


Don Clugston wrote:
> Daniel Keep wrote:
>>
> 
> When you use floating point, you want to specify the formatting options 
> almost every time -- do you want %f, %e, %g, or %a? And it's almost 
> always necessary to specify the number of decimal places to use.
> I display integers in hex pretty often, too.

Most of the time I want the same number of decimal places.  I think 
being able to provide a default decimal place would be a good idea.

Perhaps it could be in the first part of the string.  Then it could just 
append it (to hide from design/localizers/myself) something like: 
"%.2f()" ~ "blar: %(value)". Or maybe "%.2f=default" ~ "blar: %(value)".

> 
> Still, being able to leave all the formatting options out, and write:
> "next=%{i+1}" is very appealing.

Agreed.



More information about the Digitalmars-d mailing list