diff --git a/pom.xml b/pom.xml
index 5cc1ca7..90a5997 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
org.fross
rpncalc
- 5.0.6
+ 5.0.7
jar
rpncalc
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index bf9b84e..85a4ddf 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -1,5 +1,5 @@
name: rpncalc
-version: '5.0.6'
+version: '5.0.7'
summary: The command line Reverse Polish Notation (RPN) calculator
description: |
RPNCalc is an easy to use command line based Reverse Polish
diff --git a/src/main/java/org/fross/rpncalc/Main.java b/src/main/java/org/fross/rpncalc/Main.java
index c63b7c3..512494f 100644
--- a/src/main/java/org/fross/rpncalc/Main.java
+++ b/src/main/java/org/fross/rpncalc/Main.java
@@ -178,7 +178,7 @@ public static void main(String[] args) {
// Loop through the stack and count the max digits before the decimal for use with the decimal
// alignment mode & overall length for right alignment mode
for (int k = 0; k < calcStack.size(); k++) {
- int decimalIndex = Format.Comma(calcStack.get(k).toPlainString()).indexOf(".");
+ int decimalIndex = Format.Comma(calcStack.get(k).toString()).indexOf(".");
// If current stack item has more digits ahead of decimal make that the max - commas are included.
if (maxDigitsBeforeDecimal < decimalIndex) {
@@ -186,8 +186,8 @@ public static void main(String[] args) {
}
// Determine the length of the longest item in the stack for right alignment
- if (Format.Comma(calcStack.get(k).toPlainString()).length() > maxLenOfNumbers) {
- maxLenOfNumbers = Format.Comma(calcStack.get(k).toPlainString()).length();
+ if (Format.Comma(calcStack.get(k).toString()).length() > maxLenOfNumbers) {
+ maxLenOfNumbers = Format.Comma(calcStack.get(k).toString()).length();
}
}
@@ -207,12 +207,12 @@ public static void main(String[] args) {
int decimalLocation = 0;
// Put in spaces to align the decimals
- if (calcStack.get(i).toEngineeringString().toLowerCase().contains("e")) {
- stkLineNumber = calcStack.get(i).toEngineeringString();
+ if (calcStack.get(i).toString().toLowerCase().contains("e")) {
+ stkLineNumber = calcStack.get(i).toString();
decimalLocation = stkLineNumber.indexOf(".");
} else {
- stkLineNumber = Format.Comma(calcStack.get(i).toEngineeringString());
+ stkLineNumber = Format.Comma(calcStack.get(i).toString());
decimalLocation = stkLineNumber.indexOf(".");
}
@@ -223,17 +223,17 @@ public static void main(String[] args) {
} else if (configAlignment.compareTo("r") == 0) {
// Right Alignment
- if (calcStack.get(i).toEngineeringString().toLowerCase().contains("e"))
- stkLineNumber = String.format("%" + maxLenOfNumbers + "s", calcStack.get(i).toEngineeringString());
+ if (calcStack.get(i).toString().toLowerCase().contains("e"))
+ stkLineNumber = String.format("%" + maxLenOfNumbers + "s", calcStack.get(i).toString());
else
- stkLineNumber = String.format("%" + maxLenOfNumbers + "s", Format.Comma(calcStack.get(i).toEngineeringString()));
+ stkLineNumber = String.format("%" + maxLenOfNumbers + "s", Format.Comma(calcStack.get(i).toString()));
} else {
// Left Alignment
- if (calcStack.get(i).toEngineeringString().toLowerCase().contains("e"))
- stkLineNumber = calcStack.get(i).toEngineeringString();
+ if (calcStack.get(i).toString().toLowerCase().contains("e"))
+ stkLineNumber = calcStack.get(i).toString();
else
- stkLineNumber = Format.Comma(calcStack.get(i).toEngineeringString());
+ stkLineNumber = Format.Comma(calcStack.get(i).toString());
}
// Finally display the current stack item after removing any spaces at the end
diff --git a/src/main/java/org/fross/rpncalc/StackObj.java b/src/main/java/org/fross/rpncalc/StackObj.java
index 51b0914..b9a48f8 100644
--- a/src/main/java/org/fross/rpncalc/StackObj.java
+++ b/src/main/java/org/fross/rpncalc/StackObj.java
@@ -73,7 +73,7 @@ public StackObj clone() throws CloneNotSupportedException {
* @return
*/
public String getAsString(int index) {
- return this.get(index).toEngineeringString();
+ return this.get(index).toString();
}
/**