From: kruland2607 Date: Mon, 4 Jun 2012 19:17:05 +0000 (+0000) Subject: Added UnitGroup.fromUnit which delegates to UnitGroup.getDefaultUnit().fromUnit. X-Git-Tag: upstream/12.09^2~205 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=1e16258802ea38fdb0725479f20f5fa4fc33d42e;p=debian%2Fopenrocket 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 --- 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.