Java examples for java.lang:double Format
format Double Percent
//package com.java2s; import java.text.NumberFormat; public class Main { public static String formatDoublePercent(double rate) { NumberFormat format = NumberFormat.getPercentInstance(); format.setMinimumFractionDigits(2); String result = format.format(rate); return result; }// w w w . ja va 2s .c o m }