At the risk of seeming pedantic, lets review some base 10 fundamentals that everyone knows.
When you have a base ten floating point number, the first number after the decimal is the integer value of that number divided by 10. The second digit after the decimal is the integer value of that number divided by 100. The next by 1000. And so on. The decimal fraction then becomes A/10 + B/100 + C/1000 + D/10000 + E/100000, etc.
The reason I'm pointing out the obvious is because when a float is stored in a computer it is represented the same way, except in binary - also obvious, but you might not have realized what it implies.
Here is a diagram showing how it is stored. The first bit of a 32 bit float is the sign bit. The next eight bits are the binary exponent. All the remaining bits are the mantissa, or fraction. To gain an extra bit of resolution an implied 1 is assumed at the beginning of the mantissa.
Just like in base 10 where the value of a digit in the fraction is that integer divided by 10 raised to the exponent for its position, in base two is it the binary 1 or 0 divided by 2 raised to the position exponent.
So the first bit is either 0/2 or 1/2, the next bit is 0/4 or 1/4, then 0/8 or 1/8, 0/16 or 1/16, and so on.
So the only floating point fractions that you can represent as an exact value are when you can add up any combination of 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + 1/64 + 1/128 + 1/256 + 1/512 +... +1/2
23 and come up with exactly that value.
By now you should see that there is an infinite number of base 10 fractions that you are not going to be able to represent to an exact value as a base 2 fraction. You can get close, but not exact. You can't get to exactly 1/10 (base 10) no matter how many bits you use. So it is futile to attempt to round a real number fraction to a specific number of digits in a computer. Wait until the number is displayed and round the display. Prior to display the number will be converted into a string of numeric characters, and the computer library routine that does this will round the string to display only a set number of digits. It does not change the float that is stored in memory however.
Here are just a few examples of base 10 numbers you cannot store in computer memory to an exact value because there is no combination of 1/2
n bits that can be summed to equal the base 10 value: 0.10, 0.20, 0.30, 0.40, 0.60, 0.70, 0.80, 0.90. Notice that that includes every possible number rounded to 1 decimal place except .5.
All computers have this limitation and it has been the subject of millions of hours of software development with lots of clever schemes to address it. Expanding to 64 bits and 128 bits has improved accuracy, but the fundamental problem is still there.
On the rare occasion that you just absolutely have to have exactly three digits and no more in the fraction for a computation then change your units. Use milliliters instead of liters, grams instead of kilograms, millivolts instead of volts, milliseconds instead of seconds, and then use integer math.