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)
| 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 |