mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Fix FormatInt.
This commit is contained in:
parent
2951f8b3d8
commit
eded10cf31
2
format.h
2
format.h
@ -1140,7 +1140,7 @@ class FormatInt {
|
||||
|
||||
public:
|
||||
explicit FormatInt(int value) {
|
||||
uint64_t abs_value = value;
|
||||
unsigned abs_value = value;
|
||||
bool negative = value < 0;
|
||||
if (negative)
|
||||
abs_value = 0 - value;
|
||||
|
@ -1287,6 +1287,7 @@ TEST(FormatterTest, Examples) {
|
||||
|
||||
TEST(FormatIntTest, FormatInt) {
|
||||
EXPECT_EQ("42", fmt::FormatInt(42).str());
|
||||
EXPECT_EQ("-42", fmt::FormatInt(-42).str());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
Loading…
Reference in New Issue
Block a user