Android Long Format convert2Percent(long readsize, long totalsize)

Here you can find the source of convert2Percent(long readsize, long totalsize)

Description

convert Percent

License

Open Source License

Declaration

public static String convert2Percent(long readsize, long totalsize) 

Method Source Code

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

import java.text.DecimalFormat;

public class Main {
    public static String convert2Percent(long readsize, long totalsize) {
        String str = "00.00%";
        float result = ((float) readsize) / (float) totalsize;
        System.out.println(result);
        DecimalFormat df = new DecimalFormat("##.##%");
        str = df.format(result);/*from ww w  .j  a  v  a 2 s. c  o  m*/
        return str;
    }
}

Related

  1. toZeroPaddedString(long value, int precision, int maxSize)
  2. splitLongs(String str)
  3. formatSize(long value)
  4. formatSpaceSize(long file_size)
  5. formatPercent(long divisor, long dividend)
  6. formatSize(long value)