Java Number Convert ConvertToMeters(double distance)

Here you can find the source of ConvertToMeters(double distance)

Description

Convert To Meters

License

LGPL

Declaration

public static double ConvertToMeters(double distance) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {
    public static double ConvertToMeters(double distance) {
        return Round((distance * 0.2), 2);
    }//from  ww w.  j  a v  a  2s.c  o m

    public static double Round(double unrounded, int precision) {
        BigDecimal bd = new BigDecimal(unrounded);
        BigDecimal rounded = bd.setScale(precision, BigDecimal.ROUND_HALF_UP);
        return rounded.doubleValue();
    }
}

Related

  1. convertToHours(long workingDuration)
  2. convertToInchesOfMercury(double altimeterSetting, String unit)
  3. convertToJBPM(Object value)
  4. convertToKg(int value)
  5. convertToLong(String decimal, int precision)
  6. convertToMm(double value)
  7. convertToMoney(float money)
  8. getMoneyConversion(int money, int divisor)
  9. numToBytes(byte[] buffer, long value)