summaryrefslogtreecommitdiff
path: root/altoslib/AltosParse.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-12 19:13:05 -0700
committerKeith Packard <keithp@keithp.com>2016-05-12 19:13:05 -0700
commitb13037fad0905c5933d1ff579122ba1357b02eea (patch)
tree083d1950a161b05e29ee59da2b1a7de16f148bb5 /altoslib/AltosParse.java
parent2f4903f903223312d0a3a03dfd413059f24a07f5 (diff)
altoslib: Store common frequencies in library version-independent form
Serializable Objects in java are very specific to the class being serialized. As we bump the name of the library on a regular basis to note API/ABI issues, this mean a saved a Serializable object in the preferences database will fail to load across library version upgrades. The saved tracker state and saved common frequencies were the only objects saved in this form; this patch adds infrastructure for writing objects in a version-independent form, and then adds support for saving frequencies in that form. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosParse.java')
-rw-r--r--altoslib/AltosParse.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/altoslib/AltosParse.java b/altoslib/AltosParse.java
index ae88182d..12499b7b 100644
--- a/altoslib/AltosParse.java
+++ b/altoslib/AltosParse.java
@@ -53,6 +53,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();
@@ -61,6 +65,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+");