String (float from, float to) { int cmp = Float.compare(from, to); if (cmp == 0) return Float.toString(from); if (Float.compare(from, -0.0f) == 0 && Float.compare(to, 0.0f) == 0) { return "\u00B10.0f"; // \u00B1 = +/- } if (from == Float.NEGATIVE_INFINITY) { if (to == Float.POSITIVE_INFINITY) return ""; return formatTo(to); } if (to == Float.POSITIVE_INFINITY) { return formatFrom(from); } return formatFrom(from) + " && " + formatTo(to); }