/** * Show the value of a double with specified number of decimal places * * @param d double value * @param dec_places number of decimal places */ private static void show2(double d, int dec_places) { System.out.println("Format.dfrac(" + d + "," + dec_places + ") == " + Format.dfrac(d, dec_places)); }
/** * Double value formatting with minimum number of significant figures in a minimum width. * This will try to do a reasonable job of getting * a representation that has min_sigfig significant figures in minimum width. * * @param d the number to format. * @param min_sigfig minimum number of significant figures * @return string representation */ public static String d(double d, int min_sigfig) { return formatDouble(d, min_sigfig, -1).trim(); }
/** * Double value formatting with minimum number of significant figures in a specified width. * This will try to do a reasonable job of getting * a representation that has min_sigfig significant figures in the specified width. * Right now, all it does is call d( double d, int min_sigfig) and left pad out to width chars. * * @param d the number to format. * @param min_sigfig minimum number of significant figures * @param width width of the result * @return string representation, right justified in field of specified width */ public static String d(double d, int min_sigfig, int width) { String s = Format.d(d, min_sigfig); return pad(s, width, true); }
/** * Get a header for display. * * @return human readable header for display */ public static String getHeader() { StringBuilder headerB = new StringBuilder(60); headerB.append("Name"); Format.tab(headerB, 20, true); headerB.append("Class"); Format.tab(headerB, 40, true); headerB.append("Parameters"); return headerB.toString(); }
/** * Create a new string by padding the existing one with blanks to specified width. * Do nothing if length is already greater or equal to width. * * @param s string to pad * @param width length of return string * @return padded string */ public static String s(String s, int width) { return pad(s, width, false); }
buff.append(" <li><em>Data size: </em>").append(Format.formatByteSize(ds.getDataSize())).append("</li>\n");
private void doOne(char c, long start, long end, long size, String name) { sbuff.setLength(0); sbuff.append(c); sbuff.append(Format.l(start, 6)); sbuff.append(" "); sbuff.append(Format.l(end, 6)); sbuff.append(" "); sbuff.append(Format.l(size, 6)); sbuff.append(" "); sbuff.append(name); debugOut.println(sbuff.toString()); }
/** * Double value formatting with minimum number of significant figures in a specified width. * This will try to do a reasonable job of getting * a representation that has min_sigfig significant figures in the specified width. * Right now, all it does is call d( double d, int min_sigfig) and left pad out to width chars. * * @param d the number to format. * @param min_sigfig minimum number of significant figures * @param width width of the result * @return string representation, right justified in field of specified width */ public static String d(double d, int min_sigfig, int width) { String s = Format.d(d, min_sigfig); return pad(s, width, true); }
/** * Get a header for display. * * @return human readable header for display */ public static String getHeader() { StringBuilder headerB = new StringBuilder(60); headerB.append("Name"); Format.tab(headerB, 20, true); headerB.append("Class"); Format.tab(headerB, 40, true); headerB.append("Parameters"); return headerB.toString(); }
/** * Create a new string by padding the existing one with blanks to specified width. * Do nothing if length is already greater or equal to width. * * @param s string to pad * @param width length of return string * @return padded string */ public static String s(String s, int width) { return pad(s, width, false); }
buff.append(" <li><em>Data size: </em>").append(Format.formatByteSize(ds.getDataSize())).append("</li>\n");
private void doOne(char c, long start, long end, long size, String name) { sbuff.setLength(0); sbuff.append(c); sbuff.append(Format.l(start, 6)); sbuff.append(" "); sbuff.append(Format.l(end, 6)); sbuff.append(" "); sbuff.append(Format.l(size, 6)); sbuff.append(" "); sbuff.append(name); debugOut.println(sbuff.toString()); }
/** * Get a String of the parameters * * @return a String of the parameters */ public String paramsToString() { return "Center lon:" + Format.d(centerLon, 3); }
/** * Show the value of a double with specified number of decimal places * * @param d double value * @param dec_places number of decimal places */ private static void show2(double d, int dec_places) { System.out.println("Format.dfrac(" + d + "," + dec_places + ") == " + Format.dfrac(d, dec_places)); }
/** * Double value formatting with minimum number of significant figures in a specified width. * This will try to do a reasonable job of getting * a representation that has min_sigfig significant figures in the specified width. * Right now, all it does is call d( double d, int min_sigfig) and left pad out to width chars. * * @param d the number to format. * @param min_sigfig minimum number of significant figures * @param width width of the result * @return string representation, right justified in field of specified width */ public static String d(double d, int min_sigfig, int width) { String s = Format.d(d, min_sigfig); return pad(s, width, true); }
/** * Get a header for display. * * @return human readable header for display */ public static String getHeader() { StringBuilder headerB = new StringBuilder(60); headerB.append("Name"); Format.tab(headerB, 20, true); headerB.append("Class"); Format.tab(headerB, 40, true); headerB.append("Parameters"); return headerB.toString(); }