Skip to content

Conversation

@orivej
Copy link
Contributor

@orivej orivej commented Oct 12, 2019

This fixes #1353 and is the first half of the fix for #1336.

I suggest reviewing commits one by one.

This is needed to support more than the current 16 types.
Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! Just one minor comment.

char* sprintf_format<float>(float value, internal::buffer<char>& buf,
sprintf_specs specs) {
// printf does not have a float format modifier, it only supports double.
return sprintf_format(double(value), buf, specs);
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest replacing this with

return sprintf_format<double>(value, buf, specs);

to avoid cast.

It handles all floating point types, not just doubles.
@vitaut vitaut merged commit 3a15ea3 into fmtlib:master Oct 12, 2019
@vitaut
Copy link
Contributor

vitaut commented Oct 12, 2019

Merged, thanks!

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.

Cannot override float processing

2 participants