@Test public void trimPositiveRoundDown() { double trimmedValue = GeoJsonUtils.trim(3.123456712); double expected = 3.1234567; assertEquals("trim to 7 digits after period", expected, trimmedValue, 1e-8); }
public static double trim(double value) { if (value > MAX_DOUBLE_TO_ROUND || value < -MAX_DOUBLE_TO_ROUND) { return value; } return Math.round(value * ROUND_PRECISION) / ROUND_PRECISION; }
GeoJsonUtils { public static double trim(double value) { if (value > MAX_DOUBLE_TO_ROUND || value < -MAX_DOUBLE_TO_ROUND) { return value; } return Math.round(value * ROUND_PRECISION) / ROUND_PRECISION; } }
GeoJsonUtils { public static double trim(double value) { if (value > MAX_DOUBLE_TO_ROUND || value < -MAX_DOUBLE_TO_ROUND) { return value; } return Math.round(value * ROUND_PRECISION) / ROUND_PRECISION; }  }
GeoJsonUtils { public static double trim(double value) { if (value > MAX_DOUBLE_TO_ROUND || value < -MAX_DOUBLE_TO_ROUND) { return value; } return Math.round(value * ROUND_PRECISION) / ROUND_PRECISION; }  static double trim(double value); }
GeoJsonUtils { public static double trim(double value) { if (value > MAX_DOUBLE_TO_ROUND || value < -MAX_DOUBLE_TO_ROUND) { return value; } return Math.round(value * ROUND_PRECISION) / ROUND_PRECISION; }  static double trim(double value);  }