Advertisement
Rukes

Untitled

Dec 30th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1.     public static String getDoubleFormat(double input) {
  2.         String format =  String.format("%.2f", input);
  3.         if (format.endsWith(".00")){
  4.             format = format.substring(0, format.length() - 3);
  5.         }
  6.         return format;
  7.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement