Skip to content

Commit

Permalink
make nan unit test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldreik committed May 29, 2019
1 parent 95b4b9c commit 7ba51da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ struct chrono_formatter {
}

void on_second(numeric_system ns) {
if(handle_nan_inf()) { return;}
if(handle_nan_inf()) {
*out++ = '.';
handle_nan_inf();
return;}

if (ns == numeric_system::standard) {
write(second(), 2);
Expand All @@ -636,7 +639,8 @@ struct chrono_formatter {

void on_24_hour_time() {
if(handle_nan_inf()) {
std::copy_n(":00", 3, out);
*out++ = ':';
handle_nan_inf();
return;
}

Expand Down

0 comments on commit 7ba51da

Please sign in to comment.