Java Long Number Divide div100(Long input)

Here you can find the source of div100(Long input)

Description

div

License

Open Source License

Declaration

public static String div100(Long input) 

Method Source Code

//package com.java2s;
/*/*from w w  w  .j  a  va2s .  c  o m*/
 * CommonUtil.java 
 *
 * Copyright 2007 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.math.RoundingMode;

import java.text.DecimalFormat;

public class Main {

    public static String div100(Long input) {
        if (input == null || input == 0) {
            return "0.0";
        }
        Double fl = input / 100d;
        DecimalFormat df = new DecimalFormat("#.##");
        df.setRoundingMode(RoundingMode.FLOOR);
        return df.format(fl);
    }
}

Related

  1. div(long dividend, long divisor)
  2. div_ceil(long n, long d)
  3. divCeil(long a, long b)
  4. divide(final long dividend, final long divisor)
  5. divide(Long d1, Long d2)