Zeroes being erroneously stripped by DataWriterUtil.java changing value
Open
- Dominant language
- Java
- Stars
- 79
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
I am using
<dependency>
<groupId>com.epam</groupId>
<artifactId>parso</artifactId>
<version>2.0.14</version>
</dependency>
in my pom.xml
On line 232 of com.epam.parso.DataWriterUtil.java it seems numbers like 2.09186791907914E10 are having the zero stripped from the exponent becoming 2.09186791907914E1
The code doing this seems to be:
private static String trimZerosFromEnd(String string) {
return string.contains(".") ? string.replaceAll("0*$", "").replaceAll("\\.$", "") : string;
}
which I believe should read
private static String trimZerosFromEnd(String string) {
return string.contains(".") && (! string.contains("E")) ? string.replaceAll("0*$", "").replaceAll("\\.$", "") : string;
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.