Here you can find the source of formatIntRate(double rateInt)
public static String formatIntRate(double rateInt)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { public static String formatIntRate(double rateInt) { try {//from w ww. j a v a 2s. c o m NumberFormat nf = new DecimalFormat("0.00"); String moneyValue = nf.format(rateInt * 100); return moneyValue + "%"; } catch (Exception ex) { return ""; } } }