]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedQuantity.java
add support for floatingPoint member of the quantity objects
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_14 / ParsedQuantity.java
index 72b6fc612165a65cad9521054e57492432b6e900..2588054ffb9419d70191c47330ac153b062973dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -21,8 +21,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class ParsedQuantity {
-    private long decimalMantissa;
-    private int decimalPlaces;
+    protected long decimalMantissa;
+    protected int decimalPlaces;
     public ParsedQuantity() {
     }
     public ParsedQuantity(String input) {
@@ -47,11 +47,11 @@ public class ParsedQuantity {
         int pointPos = input.indexOf('.');
         if (pointPos >= 0) {
             String integral = input.replace(".", "");
-            decimalMantissa = Long.valueOf(integral);
+            decimalMantissa = Long.parseLong(integral);
             decimalPlaces = input.length() - pointPos - 1;
         }
         else {
-            decimalMantissa = Long.valueOf(input);
+            decimalMantissa = Long.parseLong(input);
             decimalPlaces = 0;
         }
     }