Original Post
I've been having a little trouble setting the precision of float values with sprintf. I have a variable numDeci which holds the precision the user wants. This is what I'm using now as a default: sprintf(buffer, "Floating point value is: %.5f", aValue); My question is this: How can I set the precision using my "numDeci" variable? I've tried a few variants like %.(numDeci)f but nothing has worked so far :P