Take for example, the number 74.38145. The user inputs how many decimal points they wish to have displayed via the sprintf_s function.
I can't for the life of me figure out how to best do this. I know how to display the float to a set number of decimal points:
char output; sprintf_s(output, "%.2f", currentValue);
How can I change the number 2 to allow for a variable number of decimal points to be displayed?