Java Number Convert convertToKg(int value)

Here you can find the source of convertToKg(int value)

Description

convert To Kg

License

LGPL

Declaration

public static double convertToKg(int value) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.math.BigDecimal;

public class Main {
    public static double convertToKg(int value) {
        return BigDecimal.valueOf(value).divide(BigDecimal.valueOf(1000)).setScale(3).doubleValue();
    }// www .  j  a va2s .c  om

    public static double convertToKg(double value) {
        return BigDecimal.valueOf(value).divide(BigDecimal.valueOf(1000)).setScale(3).doubleValue();
    }
}

Related

  1. convertStringToObjectWrapper(String className, String value)
  2. convertToDecimal(Number n)
  3. convertToHours(long workingDuration)
  4. convertToInchesOfMercury(double altimeterSetting, String unit)
  5. convertToJBPM(Object value)
  6. convertToLong(String decimal, int precision)
  7. ConvertToMeters(double distance)
  8. convertToMm(double value)
  9. convertToMoney(float money)