Java Percentage Format formatPercentage(double perc)

Here you can find the source of formatPercentage(double perc)

Description

Format as a percentage

License

Open Source License

Parameter

Parameter Description
perc the value to format

Return

the value as a percentage

Declaration

static public String formatPercentage(double perc) 

Method Source Code

//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);
    }
}

Related

  1. formatPercent(double v)
  2. formatPercent(double v)
  3. formatPercent(final long value, final long total)
  4. formatPercent(float p_num)
  5. formatPercent1dp(double frac)
  6. formatPercentage(Double percentage)
  7. formatPercentage(double percentage)
  8. formatPercentage(double percentage)
  9. formatPercentage(int enumerator, int denominator)