I use this following code to round down any float to 2 decimals.
(int((number)*100))/100
For example: 112.4423 > 112.44
, 100.3478 > 100.34 (not 100.35)
Yes it does the job but not for a large float with more than 16 digits (which will be transformed into exponents like this 10000000000000000.0 > 1e+16
)
Is there a more practical way of round down a float which might fix this problem? and please tell me that am I providing enough information or not, Thanks.