The state of string interpolation

David Gileadi gileadisNOSPM at gmail.com
Fri Dec 7 18:37:31 UTC 2018


On 12/7/18 11:26 AM, H. S. Teoh wrote:
> One thing I like about format() that string interpolation doesn't
> (easily) give, is the ability to specify additional formatting
> parameters, e.g., %6.2f, or %04X. You'd have to basically "uglify"
> string interpolation in much the same ways in order to get equivalent
> functionality, e.g., (hypothetical syntax) "Price is ${6.2:price}.".

This seems like it would fit with the existing language:

"Price is ${6.2.price}."

SomeFormattingRange price(double d) {..}


More information about the Digitalmars-d mailing list