Java tutorial
//package com.java2s; public class Main { public static String DoubleFormat(Double val) { try { return String.format("%.2f", val); } catch (Exception e) { e.printStackTrace(); } return "0.00"; } }