2018-05-10 13:17:32 UTC
Upto now I've, using wsprintf of user32.dll, simply printed a float using
"%g" as the format. The drawback of that is that, when the float has no
fractional part, it doesn't print a decimal dot and as such it gets
indistinguishable from an int.
So I went looking for a way to print something which would always print a
decimal point and at least a single decimal right of it. But alas.
Either all I get is a decimal dot with no decimals ("%#.g") or a fixed
number of decimals ("%#.3g" or "%#g") . None of which are what I'm looking
And although I entertained the thought of using the last format ("%#g") and
than nibbeling off zeroes from the right, that would cause problems when the
result isn't a simple float (but one with an exponent). In other words,
mucking about the resulting string doesn't look like a good idea ...
Does anyone have an idea how to go about this ?