Android Long Format formatPercent(long divisor, long dividend)

Here you can find the source of formatPercent(long divisor, long dividend)

Description

format Percent

Declaration

public static String formatPercent(long divisor, long dividend) 

Method Source Code

//package com.java2s;

import java.util.Locale;

public class Main {
    public static String formatPercent(long divisor, long dividend) {
        if (dividend == 0) {
            return null;
        }/*from   w  ww .j  ava 2  s .c  om*/

        double ret = (double) (divisor * 100) / dividend;
        return String.format(Locale.CHINA, "%.2f%%", ret);
    }
}

Related

  1. toZeroPaddedString(long value, int precision, int maxSize)
  2. splitLongs(String str)
  3. convert2Percent(long readsize, long totalsize)
  4. formatSize(long value)
  5. formatSpaceSize(long file_size)
  6. formatSize(long value)
  7. getTimeFormattedFromMillis(long millis)
  8. formatFileSize(long length)
  9. ReadableByteCount(long bytes)