MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / convert

Method convert

src/org/albite/util/units/Unit.java:206–210  ·  view source on GitHub ↗

Converts quantity from one unit to another unit @param quantity the quantity in the initial units @param from the initial units @param to the units after conversion @return the quantity in the units after conversion

(
            final double quantity, final Unit from, final Unit to)

Source from the content-addressed store, hash-verified

204 * @return the quantity in the units after conversion
205 */
206 public static double convert(
207 final double quantity, final Unit from, final Unit to) {
208
209 return to.inSpecUnits(from.inBaseUnits(quantity));
210 }
211
212 private double inBaseUnits(final double inSpecUnits) {
213 return (ratio * inSpecUnits + a) * x;

Callers 1

convertUnitsMethod · 0.95

Calls 2

inSpecUnitsMethod · 0.80
inBaseUnitsMethod · 0.80

Tested by

no test coverage detected