Here you can find the source of getPercentNumber(double num, int scale)
public static String getPercentNumber(double num, int scale)
//package com.java2s; //License from project: Apache License import java.text.NumberFormat; public class Main { public static String getPercentNumber(double num, int scale) { NumberFormat format = NumberFormat.getPercentInstance(); format.setMinimumFractionDigits(scale); return format.format(num); }/*from w w w. j av a2 s.c o m*/ }