private String roundToClosestIncrement ( double distance ) { int roundedNumber = ( ( int ) Math . round ( distance ) ) / roundingIncrement * roundingIncrement ; return String . valueOf ( roundedNumber < roundingIncrement ? roundingIncrement : roundedNumber ) ; }
Returns number rounded to closest specified rounding increment unless the number is less than the rounding increment then the rounding increment is returned