Java KMH Convert knotsToKmh(Double knots)

Here you can find the source of knotsToKmh(Double knots)

Description

Converts knots to kilometers per hour.

License

Open Source License

Declaration

public static Double knotsToKmh(Double knots) 

Method Source Code

//package com.java2s;
/**/*from w  w w  .  j a  v a2  s  .c o m*/
 * Copyright (c) 2010-2018 by the respective copyright holders.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

import java.math.BigDecimal;

public class Main {
    private static final BigDecimal KMH_TO_KNOTS = new BigDecimal("0.539956803");

    /**
     * Converts knots to kilometers per hour.
     */
    public static Double knotsToKmh(Double knots) {
        if (knots == null) {
            return null;
        }

        BigDecimal retour = new BigDecimal(knots);
        retour = retour.divide(KMH_TO_KNOTS, 2, BigDecimal.ROUND_FLOOR);
        return retour.doubleValue();
    }
}

Related

  1. kmh2ms(double kmh)
  2. kmhToKnots(Double kmh)
  3. kmhToMps(Double kmh)
  4. kmhToMs(long kmh)
  5. kntsToKmh(int knots)
  6. msToKmh(final float ms)
  7. msToKmh(float ms)