From 1e16258802ea38fdb0725479f20f5fa4fc33d42e Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Mon, 4 Jun 2012 19:17:05 +0000 Subject: [PATCH] Added UnitGroup.fromUnit which delegates to UnitGroup.getDefaultUnit().fromUnit. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@750 180e2498-e6e9-4542-8430-84ac67f01cd8 --- 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 67140bad..75774dc1 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. -- 2.47.2