2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.fronius.internal.math;
16 * Helper class for unit conversions
18 * @author Thomas Rokohl - Initial contribution
21 public class SiPrefixFactors {
24 * return the relative factor to the base unit
25 * k == 1000, M = 1000000 ...
26 * Not completely!!! Rank from n to T
28 * @param prefix of the unit
29 * @return relative factor to the base unit
32 public static double getFactorToBaseUnit(String prefix) {
33 if (prefix.isEmpty()) {
38 return 1000000000000d;