-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support formatting of subseconds #3115
Conversation
d579b8e
to
1177880
Compare
Please rebase. |
1177880
to
64a40c2
Compare
Rebased on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
bf1f08b
to
61b6f97
Compare
I reworked everything again.
|
61b6f97
to
bac8f93
Compare
bac8f93
to
ea1be08
Compare
…ctional durations
2adcc0c
to
08ded4d
Compare
08ded4d
to
d7f2a70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, just a few more minor comments.
Thank you! |
Fuzzer discovered an issue with this change. The following code #include <fmt/chrono.h>
int main() {
fmt::format("{:%S}", std::chrono::duration<char, std::ratio<1, 100> >(0x80));
} now results in an assertion failure:
|
Thanks for the fix and sorry that I have overseen this! |
Here's a link to the oss-fuzz report for future reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52380. |
The formatting symbol
{%S}
should also print the subseconds, e.g.,fmt::format("{:%S}", std::chrono::microseconds(1234567))
should print "01.234567".Didn't implement it for localized output as this localized output looks like black magic to me... may be we can omit it for the localized formatting for the first time?