Here you can find the source of convertToKg(int value)
public static double convertToKg(int value)
//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(); } }