We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
toJsonString
The json specification requires a "." for decimal separator: https://www.json.org/json-en.html
toJsonString uses "," for decimal separator for some system locales like German or Spanish
Test to reproduce the issue:
import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Locale; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; public class DecimalPointFormattingTest { @Test void formatsNumbersWithDecimalDot() { Locale.setDefault(Locale.GERMAN); Map fields = new HashMap<String, Object>(); fields.put("number", 1.1); com.beust.klaxon.JsonObject json = new com.beust.klaxon.JsonObject(fields); String string = json.toJsonString(false, true); assertEquals("{\"number\":1.1E0}", string); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The json specification requires a "." for decimal separator: https://www.json.org/json-en.html
toJsonString
uses "," for decimal separator for some system locales like German or SpanishTest to reproduce the issue:
The text was updated successfully, but these errors were encountered: