Skip to content
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

Serialize fractional numbers with trailing decimal point and value #3660

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Apr 11, 2019

This commit updates

  • the DoubleToStringConverter from utf8json to
    always emit a trailing decimal point and trailing decimal value when
    serializing floating point numbers to JSON.
  • the DecimalFormatter from utf8json to always emit a trailing decimal
    point and trailing decimal value when serializing floating point numbers to JSON.

Update unit tests to reflect this change

Fixes #3657

This commit updates

- the DoubleToStringConverter from utf8json to
always emit a trailing decimal point and trailing decimal value when
serializing floating point numbers to JSON.
- the DecimalFormatter from utf8json to always emit a trailing decimal
point and trailing decimal value when serializing floating point numbers to JSON.

Update unit tests to reflect this change

Fixes #3657
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@@ -214,7 +215,7 @@ enum Flags
//const int max_leading_padding_zeroes_in_precision_mode_;
//const int max_trailing_padding_zeroes_in_precision_mode_;

static readonly Flags flags_ = Flags.UNIQUE_ZERO | Flags.EMIT_POSITIVE_EXPONENT_SIGN;
static readonly Flags flags_ = Flags.UNIQUE_ZERO | Flags.EMIT_POSITIVE_EXPONENT_SIGN | Flags.EMIT_TRAILING_DECIMAL_POINT | Flags.EMIT_TRAILING_ZERO_AFTER_POINT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So happy these flags exist and problem is solved at the root!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants