Here you can find the source of formatPercentage(double perc)
Parameter | Description |
---|---|
perc | the value to format |
static public String formatPercentage(double perc)
//package com.java2s; /**/*from w ww . j a v a 2s.co m*/ * * $Id: Utils.java 28 2005-06-20 13:13:35Z rej $ * * Copyright (c) 2002 Sun Microsystems, Inc. * * * * See the file "license.terms" for information on usage and redistribution * * of this file, and for a DISCLAIMER OF ALL WARRANTIES. **/ import java.text.NumberFormat; public class Main { /** ****************** Formatting ******************* */ static private NumberFormat percentFormatter; /** * Format as a percentage * @param perc the value to format * @return the value as a percentage */ static public String formatPercentage(double perc) { return percentFormatter.format(perc); } }