@Test public void ShouldRoundToCeil_WhenHigherValueOfExactPointIsGiven() { assertThat(GlucosioConverter.round(10.126, 2)).isEqualTo(10.13); }
public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); }
GlucosioConverter { public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); } }
GlucosioConverter { public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); } private  GlucosioConverter(); }
GlucosioConverter { public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); } private  GlucosioConverter(); static double round(double value, int places); static double glucoseToMgDl(double mmolL); static double glucoseToMmolL(double mgDl); static double glucoseToA1C(double mgDl); static double a1cToGlucose(double a1c); static double kgToLb(double kg); static double lbToKg(double lb); static double a1cNgspToIfcc(double ngsp); static double a1cIfccToNgsp(double ifcc); }
GlucosioConverter { public static double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); } private  GlucosioConverter(); static double round(double value, int places); static double glucoseToMgDl(double mmolL); static double glucoseToMmolL(double mgDl); static double glucoseToA1C(double mgDl); static double a1cToGlucose(double a1c); static double kgToLb(double kg); static double lbToKg(double lb); static double a1cNgspToIfcc(double ngsp); static double a1cIfccToNgsp(double ifcc);  }