These ways all work, but I have a way that I personally like just because it keeps things relatively simple to look at by using Modulo.
NOTE: This will not give you exactly the same mathematical result of other methods shown above. This technically doesn’t round the value, but instead just removes any remainder below a certain decimal. Whether or not this is okay depends on why you’re rounding it. I like this method if I’m just trying to make a float more human-readable, where precision is less important.
For example, if you were doing it to one decimal point, both values 1.92 and 1.99 would return 1.9, instead of 1 and 2.
