public ScientificRenderer(int sigfigs) { sigfigs = Math.min(sigfigs, 6); if (format instanceof DecimalFormat) { String pattern = "0.0"; // $NON-NLS-1$ for (int i = 0; i < sigfigs - 1; i++) { pattern += "0"; // $NON-NLS-1$ } pattern += "E0"; // $NON-NLS-1$ ((DecimalFormat) format).applyPattern(pattern); } }
static { df = new DecimalFormat(); df.applyPattern("#.##"); }