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

Change the implementation in string a number in the string pre-built function #3249

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

cosmicshuai
Copy link
Contributor

@cosmicshuai cosmicshuai commented Feb 1, 2021

Currently, the string pre-built function does not always work correctly for numeric inputs.
for example: string(1.22, 'de-DE') returns 1.22. It is not the same as the result of C#.

So I switched the toLocaleString() to d3-format in the string function while a numeric input passed.
With the change, now string(1.22, 'de-DE') will return: 1,22

@cosmicshuai cosmicshuai marked this pull request as ready for review February 1, 2021 09:06
@cosmicshuai cosmicshuai requested review from a team as code owners February 1, 2021 09:06
@cosmicshuai cosmicshuai requested review from Stevenic and tomlm February 1, 2021 09:06
@coveralls
Copy link

coveralls commented Feb 1, 2021

Pull Request Test Coverage Report for Build 529473685

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 84.679%

Files with Coverage Reduction New Missed Lines %
libraries/adaptive-expressions/src/builtinFunctions/string.ts 2 84.78%
Totals Coverage Status
Change from base Build 529161273: -0.002%
Covered Lines: 18208
Relevant Lines: 20514

💛 - Coveralls

@joshgummersall joshgummersall merged commit 28baeda into main Feb 3, 2021
@joshgummersall joshgummersall deleted the shuwan/changeStringLocale branch February 3, 2021 15:37
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.

4 participants