I have a question, can you limit the number of decimal places in C ++?
float x = 2.958;
Instead of rounding up or down using floorf
, roundf
, can you just pick up the two numbers after the comma?
That would look more or less like this
float x = 2.95;