projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosuilib: Track open frames, exit when none remain
[fw/altos]
/
altoslib
/
AltosParse.java
diff --git
a/altoslib/AltosParse.java
b/altoslib/AltosParse.java
index 1cbddcf9ef9dfbc4c68cf7c20a6c3a5cb84b30f5..fbd049ae7a3da093c89de7ea5345546a4d3b8bf5 100644
(file)
--- a/
altoslib/AltosParse.java
+++ b/
altoslib/AltosParse.java
@@
-15,7
+15,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_1
0
;
+package org.altusmetrum.altoslib_1
1
;
import java.util.*;
import java.text.*;
import java.util.*;
import java.text.*;
@@
-26,6
+26,14
@@
public class AltosParse {
}
public static int parse_int(String v) throws ParseException {
}
public static int parse_int(String v) throws ParseException {
+ try {
+ return (int) AltosLib.fromdec(v);
+ } catch (NumberFormatException e) {
+ throw new ParseException("error parsing int " + v, 0);
+ }
+ }
+
+ public static long parse_long(String v) throws ParseException {
try {
return AltosLib.fromdec(v);
} catch (NumberFormatException e) {
try {
return AltosLib.fromdec(v);
} catch (NumberFormatException e) {
@@
-53,6
+61,10
@@
public class AltosParse {
}
}
}
}
+ public static String format_double_locale(double number) {
+ return nf_locale.format(number);
+ }
+
public static double parse_double_net(String str) throws ParseException {
try {
return nf_net.parse(str.trim()).doubleValue();
public static double parse_double_net(String str) throws ParseException {
try {
return nf_net.parse(str.trim()).doubleValue();
@@
-61,6
+73,10
@@
public class AltosParse {
}
}
}
}
+ public static String format_double_net(double number) {
+ return nf_net.format(number);
+ }
+
public static double parse_coord(String coord) throws ParseException {
String[] dsf = coord.split("\\D+");
public static double parse_coord(String coord) throws ParseException {
String[] dsf = coord.split("\\D+");