@Test
public void testFloatFormat() {

    DecimalType dt;
    // We know that DecimalType calls "String.format()" without a locale. So
    // we have to do the same thing here in order to get the right decimal
    // separator.
    final char sep = (new DecimalFormatSymbols().getDecimalSeparator());
    // A float value with float conversion.
    dt = new DecimalType("11.123");
    assertEquals("11" + sep + "1", dt.format("%.1f")); // "11.1"
    // An integer value with float conversion. This has to work.
    dt = new DecimalType("11");
    assertEquals("11" + sep + "0", dt.format("%.1f")); // "11.0"
    // An integer value with float conversion. This has to work.
    dt = new DecimalType("11.0");
    assertEquals("11" + sep + "0", dt.format("%.1f")); // "11.0"
}