From 56f157a7a5f09b2892ec3f264f5d502716f69d23 Mon Sep 17 00:00:00 2001 From: Kevin Ruland Date: Mon, 4 Jun 2012 19:17:05 +0000 Subject: [PATCH] Added UnitGroup.fromUnit which delegates to UnitGroup.getDefaultUnit().fromUnit. --- core/src/net/sf/openrocket/unit/UnitGroup.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/net/sf/openrocket/unit/UnitGroup.java b/core/src/net/sf/openrocket/unit/UnitGroup.java index 67140bad1..75774dc1c 100644 --- a/core/src/net/sf/openrocket/unit/UnitGroup.java +++ b/core/src/net/sf/openrocket/unit/UnitGroup.java @@ -458,6 +458,17 @@ public class UnitGroup { return units.toArray(new Unit[0]); } + /** + * Return the value in SI units from the default unit of this group. + * It is the same as calling getDefaultUnit().fromUnit(value) + * + * @param value the default unit value to convert + * @return the value in SI units. + * @see Unit#fromUnit(double) + */ + public double fromUnit( double value ) { + return this.getDefaultUnit().fromUnit(value); + } /** * Return the value formatted by the default unit of this group.