Java Number Convert convert(long value, long factor, int comma)

Here you can find the source of convert(long value, long factor, int comma)

Description

Converter from long to bigDecimal

License

Open Source License

Declaration

private static BigDecimal convert(long value, long factor, int comma) 

Method Source Code

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

import java.math.*;

public class Main {
    /**/*from  ww  w .j a  v  a 2  s. c  om*/
     * Converter from long to bigDecimal
     */
    private static BigDecimal convert(long value, long factor, int comma) {
        BigDecimal retVal = new BigDecimal(value);
        retVal = retVal.divide(new BigDecimal(factor), comma,
                BigDecimal.ROUND_HALF_UP);
        return retVal;
    }
}

Related

  1. convertBytesToKBytes(String value)
  2. convertBytesToUnit(long bytes)
  3. convertCount(Object obj)
  4. convertDurationToMillis(String time)