Package org.djunits.value.util
Class ValueUtil
java.lang.Object
org.djunits.value.util.ValueUtil
ValueUtil implements a couple of unit-related static methods.
Copyright (c) 2015-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
expressAsSIUnit
(double value, Unit<?> unit) Convert a value in a given unit into the equivalent in the standard SI unit.static double
expressAsUnit
(double siValue, Unit<?> targetUnit) Convert a value from the standard SI unit into a compatible unit.
-
Method Details
-
expressAsSIUnit
Convert a value in a given unit into the equivalent in the standard SI unit.- Parameters:
value
- double; the value to convert into the standard SI unitunit
- Unit<?>; the unit of the given value- Returns:
- double; the value in the standard SI unit
-
expressAsUnit
Convert a value from the standard SI unit into a compatible unit.- Parameters:
siValue
- double; the given value in the standard SI unittargetUnit
- Unit<?>; the unit to convert the value into- Returns:
- double; the value in the targetUnit
-