C++ how to set a fixed decimal precision for a float
问题 I have an API call which returns a double. The double's decimal length can variate from many decimal places to a few (it all comes down to the state of an actuator). This double represents the current position on the range radius of an actuator. I am not interested in such a detailed number, because it adds alot of noise to the system. I've been using floats to save space, but still I have floats which have 6-8 decimal length. I am not interested in floor or ceil, simply because it doesn't do