I am building a class that will be required to round doubles.
In it, based on input n, it will (at max) have n decimal places and skip trailing zeroes if possible.
//If n = 2,
//1.697 -> 1.7 (instead of 1.70) (edit)
//1.000 -> 1 (instead of 1.00)
//1.658 -> 1.66
There seems to be numerous rounding techniques but I'm not sure which one is applicable for my case.
Any help would be appreciated. Thank you