mirror of
https://github.com/fmtlib/fmt.git
synced 2026-02-09 08:35:28 +01:00
Fix FormatInt.
This commit is contained in:
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>
|
||||
|
||||
Reference in New Issue
Block a user