aboutsummaryrefslogtreecommitdiff
path: root/src/utilities/EFormatter.java
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
committerJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
commit1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch)
tree926cef8cb76d46862ed2c4ec7028720611e47476 /src/utilities/EFormatter.java
downloadModulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip
added source
Diffstat (limited to 'src/utilities/EFormatter.java')
-rw-r--r--src/utilities/EFormatter.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/utilities/EFormatter.java b/src/utilities/EFormatter.java
new file mode 100644
index 0000000..d9a060b
--- /dev/null
+++ b/src/utilities/EFormatter.java
@@ -0,0 +1,26 @@
+/* */ package utilities;
+/* */
+/* */ public class EFormatter extends DecimalFormatter
+/* */ {
+/* */ private int base;
+/* */
+/* */ public EFormatter(int radix, int base, boolean flt)
+/* */ {
+/* 14 */ super(radix, flt);
+/* 15 */ this.base = base;
+/* */ }
+/* */
+/* */ public String format(String str) {
+/* 19 */ if (Double.parseDouble(str) < this.base) return str;
+/* 20 */ String temp = super.eNotation(str);
+/* 21 */ String exp = temp.substring(temp.lastIndexOf("e") + 1);
+/* 22 */ temp = temp.substring(0, temp.lastIndexOf("e") + 1);
+/* 23 */ exp = BaseConverter.convertFromDecimal(Long.parseLong(exp), this.base);
+/* 24 */ return temp + exp;
+/* */ }
+/* */ }
+
+/* Location: Modulus.jar
+ * Qualified Name: utilities.EFormatter
+ * JD-Core Version: 0.6.2
+ */ \ No newline at end of file