Java Kelvin To Celsius kelvinToCelsius(double temperature)

Here you can find the source of kelvinToCelsius(double temperature)

Description

kelvin To Celsius

License

Apache License

Declaration

public static double kelvinToCelsius(double temperature) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {
    public static double kelvinToCelsius(double temperature) {
        return scaleTemperature(temperature - 273.15);
    }//w ww  .java2 s  . co m

    public static double scaleTemperature(double value) {

        return new BigDecimal(value).setScale(1, BigDecimal.ROUND_HALF_EVEN).intValue();
    }
}