-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DecimalFormat Does Not Suppress Negative Sign #167
Comments
Thanks for the report, I tested this and you're right. Are you interested on fixing it? |
Apparently, this also does not work:
|
I looked at the JavaDoc and it does not look trivial to implement it from scratch. I saw a couple of implementation in JavaScript in Github. One is has MIT and another has BSD-3. Android SDK is under Apache, which might be compatible with BSD? Do you think it's okay to port it? |
Signed-off-by: Carlos Quiroz <carlos.m.quiroz@gmail.com>
I agree it is not trivial, the algorithm was created by hand and obviously the parsing of the format is missing some cases. Essentially you can't look at jdk code or harmony |
I added your example as an ignored test |
If you're okay with an external JS lib, this implementation appears to be good: https://github.com/DeloitteDigitalAPAC/DecimalFormat They did it with a formalized parser and lots of tests. It also accepts a locale as input. I did a browserify with it and ran it in ScalaJS with some of my unit test and so far so good. I'll try to do a CI test later this week to see if it holds up. |
That's interesting. I wouldn't expect a js library implementing a java spec. It maybe used I think provided it doesn't add up too much in terms of size. |
I've been using it for two weeks trying different things and it seems solid. About 14KB minimized. |
That sounds great, if you want to submit a PR it would be ok, Let's keep the old version in a cross project for a future scala native release |
This test case passes in JVM but not in JS:
The text was updated successfully, but these errors were encountered: