Re: std.format expand "%s"

2017-08-22 Thread jmh530 via Digitalmars-d-learn
On Monday, 21 August 2017 at 15:39:04 UTC, Steven Schveighoffer wrote: What I mean is that %s goes to %d for isIntegral!(typeof(x)), and %s goes to %g for isFloatingPoint!(typeof(x)), and stays as %s for everything else. Given this, you could probably write the function you were looking for

Re: std.format expand "%s"

2017-08-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/21/17 10:58 AM, jmh530 wrote: On Monday, 21 August 2017 at 13:57:01 UTC, Steven Schveighoffer wrote: Well, for most things, %s does not do the same thing as another specifier. It's only integers, which format the same as %d, and floating points, which format the same as %g. For all oth

Re: std.format expand "%s"

2017-08-21 Thread jmh530 via Digitalmars-d-learn
On Monday, 21 August 2017 at 13:57:01 UTC, Steven Schveighoffer wrote: Well, for most things, %s does not do the same thing as another specifier. It's only integers, which format the same as %d, and floating points, which format the same as %g. For all others, the format is specified as %s.

Re: std.format expand "%s"

2017-08-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/20/17 9:52 PM, jmh530 wrote: I'm playing around with std.format and I'm trying to figure out if there is any way to identify what "%s" should expand to. So for instance: int x = 1; auto result = x.format!"%s"; I would know that result="1". I could run "1" through unformatValue and get ba

std.format expand "%s"

2017-08-20 Thread jmh530 via Digitalmars-d-learn
I'm playing around with std.format and I'm trying to figure out if there is any way to identify what "%s" should expand to. So for instance: int x = 1; auto result = x.format!"%s"; I would know that result="1". I could run "1" through unformatValue and get back 1. I'm looking to see if there i