Java Long Number Format format(final long value, final long divider, final String unit)

Here you can find the source of format(final long value, final long divider, final String unit)

Description

format

License

Open Source License

Declaration

public static String format(final long value, final long divider, final String unit) 

Method Source Code

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

public class Main {
    public static String format(final long value, final long divider, final String unit) {
        final double result = divider > 1 ? (double) value / (double) divider : (double) value;
        return String.format("%.1f %s", result, unit);
    }//from  w  ww . jav a  2  s. c  o  m
}

Related

  1. comma(long n)
  2. format(final long number, final int length)
  3. format(final long value, final long divider, final String unit)
  4. format(long bytes)
  5. format(long mem)
  6. format(long milliseconds)