Java Integer Format convertInt2Percent(int num)

Here you can find the source of convertInt2Percent(int num)

Description

convert Int Percent

License

Open Source License

Declaration

public static double convertInt2Percent(int num) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.DecimalFormat;

public class Main {
    public static double convertInt2Percent(int num) {
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        String ret = decimalFormat.format(Double.valueOf("0." + num));
        return Double.valueOf(ret);
    }/*  w w  w.j  ava 2s .c om*/
}

Related

  1. format(int c)
  2. format(int color)
  3. format(int i, int fillLength)
  4. format(int i, int length, boolean left_justify, char fill)