How to Extract Two Decimal Places Without Rounding in STM32?
Dear STM32 Community,
I am currently working on a project using STM32CubeIDE, and I need to perform calculations that involve floating-point numbers. Specifically, I would like to extract exactly two decimal places from a float number without rounding. For example, if the value is 1.61859652354, I want to obtain 1.61 (not 1.62).
I have tried rounding methods, but they do not meet my requirements as they round the value up or down. Instead, I need a way to truncate the value after two decimal places for further use in my calculations.
Could anyone suggest the best approach or method to achieve this in STM32CubeIDE?
Thank you in advance for your help!
