public static double scaleTMP(final int port, final int raw, boolean celsius){
        double result = (((raw/getResolution(port))*VCC) - 0.5)*100;

        if (!celsius)
            // Convert to fahrenheit
            result = result*((double)9/5) + 32;

        return new BigDecimal(result).setScale(2, RoundingMode.HALF_UP)
                .doubleValue();
    }