MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / fd

Method fd

src/main/java/com/volmit/adapt/util/Form.java:1050–1060  ·  view source on GitHub ↗

Formats a double's decimals to a limit, however, this will add zeros to the decimal places that dont need to be placed down. 2.4343 formatted with 6 decimals gets returned as 2.434300 @param i the double @param p the number of decimal places to use @return the formated string

(double i, int p)

Source from the content-addressed store, hash-verified

1048 * @return the formated string
1049 */
1050 public static String fd(double i, int p) {
1051 String form = "0";
1052
1053 if (p > 0) {
1054 form = form + "." + repeat("0", p);
1055 }
1056
1057 DF = new DecimalFormat(form);
1058
1059 return DF.format(i);
1060 }
1061
1062 /**
1063 * Formats a float's decimals to a limit

Callers 3

durationMethod · 0.95
memxMethod · 0.95
nsMsdMethod · 0.95

Calls 1

repeatMethod · 0.95

Tested by

no test coverage detected