suppose I do that:
dMyDouble =120.2
sprintf(szMyString, "%.2f", dMyDouble);
szMyString will be "120.20"
Is there a way to get "120.2" and not by:
sprintf(szMyString, "%.1f", dMyDouble);
since I want up to 2 decimal digits
Thanks
Printable View
suppose I do that:
dMyDouble =120.2
sprintf(szMyString, "%.2f", dMyDouble);
szMyString will be "120.20"
Is there a way to get "120.2" and not by:
sprintf(szMyString, "%.1f", dMyDouble);
since I want up to 2 decimal digits
Thanks
You'll have to trim off the trailing zero programmatically.
-rick