-
Notifications
You must be signed in to change notification settings - Fork 185
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
custommized format of double number's string value #117
Comments
Since JsonNumber class's access right is the same package, even Json is a non-final class, I can't solve this problem. |
Can yu solve this by creating your own writer? PrettyPrint might show some pointers as to how: |
Since |
is it possible to make some key/common classes'access right to make them more extensible and configurable |
I have a requirement that If the float(double) value has an exponent, the "e" MUST be in lower
case. in our case,when serializing a JsonObject as a String, For example,
Because of the internal call to
Json.value(value)
, thenDouble.toString(value)
, this becomes2.1474836471E10
Since Json is a final class, there are no extensible way to override methods. If we provide an extension, such as my extension class Enhancejson.value method, which I can implement with
Double.toString(value).toLowerCase()
.My question is, if we can change Json to a non-final class, or is there a better way to solve this problem?
if no workaround, I'll consider to make a Pull Request. Thank you very much.
The text was updated successfully, but these errors were encountered: