help with sprintf - float

Started by
1 comment, last by 31337noob 19 years, 1 month ago
How do i make sprintf use floats with only 2 decimal places. for ex. 50.10 not 50.10000000000 please help. thanks in advance
Advertisement
Try:
sprintf(buf, "%.2f", value);
Quote:Original post by doynax
Try:
sprintf(buf, "%.2f", value);


thanks it worked

This topic is closed to new replies.

Advertisement