Java Number Convert convertGeoCoordinateToDouble(int point)

Here you can find the source of convertGeoCoordinateToDouble(int point)

Description

Takes a Lat or Long as an int and converts to a double.

License

Apache License

Parameter

Parameter Description
point a parameter

Declaration

public static double convertGeoCoordinateToDouble(int point) 

Method Source Code

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

import java.math.BigDecimal;

public class Main {
    private final static int LAT_LONG_CONVERSION_FACTOR = 10000000;
    private final static int LAT_LONG_DECIMAL_PRECISION = 7;

    /**// w w  w.  ja  va2s .  co m
     * Takes a Lat or Long as an int and converts to a double.
     * @param point
     * @return
     */
    public static double convertGeoCoordinateToDouble(int point) {
        double convertedPoint = ((double) point)
                / LAT_LONG_CONVERSION_FACTOR;
        BigDecimal bd = new BigDecimal(convertedPoint);
        bd.setScale(LAT_LONG_DECIMAL_PRECISION, BigDecimal.ROUND_HALF_UP);
        return bd.doubleValue();
    }
}

Related

  1. convertBytesToUnit(long bytes)
  2. convertCount(Object obj)
  3. convertDurationToMillis(String time)
  4. convertedFileSize(Long fileSize)
  5. convertFromMsToMinutes(Integer duration)
  6. convertImperialToMetric(String areaImp)
  7. convertJcoDecimalDefaultValue( String jcoDefaultDecimalValue)
  8. convertMB2GB(int valueMB)
  9. convertMinutesToHours(Long minutes)