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

Specialized TfStringify for integral types to prevent locale dependent writes #3222

Conversation

erslavin
Copy link
Contributor

Description of Change(s)

Specializes TfStringify for common integral types to prevent locale dependent writes of numeric data.

Fixes Issue(s)

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

  support locale independent writes
@erslavin erslavin changed the title - Specialized TfStringify for integral types to Specialized TfStringify for integral types to prevent locale dependent writes Aug 12, 2024
@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-9967

@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

pxr/base/tf/stringUtils.h Outdated Show resolved Hide resolved
pxr/base/tf/testenv/stringUtils.cpp Outdated Show resolved Hide resolved
pxr/base/tf/testenv/stringUtils.cpp Outdated Show resolved Hide resolved
@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@spitzak
Copy link

spitzak commented Dec 5, 2024

std::to_chars prints the shortest possible sequence of digits that accurately represents the floating-point number being encoded. You can't do that with printf the best you can do is %.18g which prints a lot of misleading extra digits instead of rounding to the nearest representative value. It would be a huge advantage to assume all conversions in USD are done using to_chars, it is not only being used to print '.' instead of ','.

@pixar-oss pixar-oss merged commit f279a85 into PixarAnimationStudios:dev Dec 9, 2024
5 checks passed
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.

6 participants