X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosUnits.java;h=7ca2f03cda27a1662f78eec13f7d9814dab5008d;hb=7975d088a4ac44c0943134fa41d0e3b88f50b98f;hp=dbdb788248ee150826ea272732e72ddb4d693da3;hpb=c8078d352a7f54a4a97d25af080155d3f875536a;p=fw%2Faltos diff --git a/altoslib/AltosUnits.java b/altoslib/AltosUnits.java index dbdb7882..7ca2f03c 100644 --- a/altoslib/AltosUnits.java +++ b/altoslib/AltosUnits.java @@ -15,7 +15,9 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_5; +package org.altusmetrum.altoslib_7; + +import java.text.*; public abstract class AltosUnits { @@ -29,13 +31,22 @@ public abstract class AltosUnits { public abstract int show_fraction(int width, boolean imperial_units); - public double parse(String s, boolean imperial_units) throws NumberFormatException { - double v = Double.parseDouble(s); + public double parse_locale(String s, boolean imperial_units) throws ParseException { + double v = AltosParse.parse_double_locale(s); + return inverse(v, imperial_units); + } + + public double parse_net(String s, boolean imperial_units) throws ParseException { + double v = AltosParse.parse_double_net(s); return inverse(v, imperial_units); } - public double parse(String s) throws NumberFormatException { - return parse(s, AltosConvert.imperial_units); + public double parse_locale(String s) throws ParseException { + return parse_locale(s, AltosConvert.imperial_units); + } + + public double parse_net(String s) throws ParseException { + return parse_net(s, AltosConvert.imperial_units); } public double value(double v) { @@ -105,4 +116,4 @@ public abstract class AltosUnits { public String say_units(double v) { return say_units(v, AltosConvert.imperial_units); } -} \ No newline at end of file +}