I want to round a double down to 1 decimal place. For example if I have a double let val = 3.1915
I want to round this down to 3.1
. Normal rounding functions will round it to 3.2
but I want to basically just drop the remaining decimal places. What is the best way to do this? Is there a native function for this? I know this is pretty straight forward to do but I want to know what the best way to do this would be where I am not using any kind of workaround or bad practices. This is not a duplicate of other rounding questions because I am not asking about about rounding, I am asking how to drop decimal places.
Similarly, if the value was 3.1215
, it would also round to 3.1