summaryrefslogtreecommitdiff
path: root/altoslib/AltosUnits.java
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2015-07-15 16:43:50 -0600
committerBdale Garbee <bdale@gag.com>2015-07-15 16:43:50 -0600
commit643c2fb03833d658320f476ef731bbb06fe3cc31 (patch)
tree878c9df5dbd9bab9169becea4e06e8bae3529541 /altoslib/AltosUnits.java
parente41786fb384892961a6547e17812a24314ce9623 (diff)
parent271f56a41c7e785b0fab7e572325df842d104277 (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altoslib/AltosUnits.java')
-rw-r--r--altoslib/AltosUnits.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/altoslib/AltosUnits.java b/altoslib/AltosUnits.java
index f6e34e77..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_6;
+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
+}