Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
   If the numeric string uses exponential notation, 1.0E4, then
   it could have a trailing '0' and that should not be stripped off,
   ; 1.0E10 should not be converted to 1.0E1.
   This would be rather bad.

[git-p4: depot-paths = "//open/mondrian/": change = 9572]
  • Loading branch information
Richard Emberson committed Jul 11, 2007
1 parent 1edf3e4 commit 23b8b2b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/mondrian/xmla/XmlaUtil.java
Expand Up @@ -290,6 +290,15 @@ public static Throwable rootThrowable(Throwable throwable) {
public static String normalizeNumericString(String numericStr) {
int index = numericStr.indexOf('.');
if (index > 0) {
// If it uses exponential notation, 1.0E4, then it could
// have a trailing '0' that should not be stripped of,
// e.g., 1.0E10. This would be rather bad.
if (numericStr.indexOf('e') != -1) {
return numericStr;
} else if (numericStr.indexOf('E') != -1) {
return numericStr;
}

boolean found = false;
int p = numericStr.length();
char c = numericStr.charAt(p - 1);
Expand Down

0 comments on commit 23b8b2b

Please sign in to comment.