List of utility methods to do Decimal Format
String | padding(final double number) padding return FORMAT.format(number);
|
String | padToMinWidth(double num, int minWidth) pad To Min Width NumberFormat nf = NumberFormat.getNumberInstance(); int intDigits = numDigits((int) num); if (intDigits >= minWidth) nf.setMaximumFractionDigits(0); else { boolean hasFracComponent = (int) num != num; if (hasFracComponent) { nf.setMaximumFractionDigits(minWidth - intDigits); ... |
String | prettyPrintLatLon(double coord, boolean isCoordKindLat) pretty Print Lat Lon boolean neg = coord < 0.0; String c; if (isCoordKindLat) { c = (neg ? "S" : "N"); } else { c = (neg ? "W" : "E"); double tAbsCoord = Math.abs(coord); ... |
void | print(double[] y)for (int i = 0; i < y.length; i++) System.out.print(_f.format(y[i]) + " "); System.out.println(); |
String | printAlpha(double a[]) print Alpha DecimalFormat df = new DecimalFormat("0.0000"); StringBuilder sb = new StringBuilder(); sb.append(df.format(a[0])); for (int i = 1; i < a.length; ++i) { sb.append(" "); sb.append(df.format(a[i])); return sb.toString(); ... |
String | printAngle(double angle) Parses an angle value. double degree = Math.toDegrees(angle); return "d" + angleFormat.format(degree); |
String | printArray(String title, double[] vect) print Array String result = title + ": "; result += arrayToString(vect); result += "\n"; return result; |
void | printArrayP(double[][] p) print Array P for (int i = 0; i < p.length; i++) { for (int j = 0; j < p[i].length; j++) { System.out.print(df.format(p[i][j])); if (!(j + 1 == p[i].length)) { System.out.print(" , "); System.out.println(""); ... |
String | PrintWith1DecAnd000Sep(double Number) Print With Dec And Sep return F2b.format(Number);
|
double | randomDouble(double minDouble, double maxDouble) random Double return minDouble == maxDouble ? minDouble : randomInt((int) getCorrectionValue(minDouble * 100000, 0), (int) getCorrectionValue(maxDouble * 100000, 0)) / 100000.0; |