sS formatDouble(double d, int digits) { S format = digits <= 0 ? "0" : "0." + rep(digits, '#'); ret decimalFormatEnglish(format, d); } sS formatDouble(double d) { ret str(d); } ifclass DoubleRange sS formatDouble(DoubleRange r, int digits) { ret r == null ? "null" : "[" + formatDouble(r.start, digits) + ";" + formatDouble(r.end, digits) + "]"; } endif