mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-01 09:24:55 +02:00
fixed GH# 65: Poco::format() misorders sign and padding specifiers
This commit is contained in:
parent
173f205cb6
commit
0434ee2b6b
@ -57,9 +57,9 @@ namespace
|
||||
switch (*itFmt)
|
||||
{
|
||||
case '-': str.setf(std::ios::left); ++itFmt; break;
|
||||
case '+': str.setf(std::ios::showpos); ++itFmt; break;
|
||||
case '+': str.setf(std::ios::showpos | std::ios::internal); ++itFmt; break;
|
||||
case '0': str.fill('0'); ++itFmt; break;
|
||||
case '#': str.setf(std::ios::showpoint | std::ios_base::showbase); ++itFmt; break;
|
||||
case '#': str.setf(std::ios::showpoint | std::ios::showbase); ++itFmt; break;
|
||||
default: isFlag = false; break;
|
||||
}
|
||||
}
|
||||
|
@ -172,6 +172,8 @@ void FormatTest::testInt()
|
||||
i = -42;
|
||||
s = format("%+d", i);
|
||||
assert (s == "-42");
|
||||
s = format("%+04d", i);
|
||||
assert (s == "-042");
|
||||
s = format("%d", i);
|
||||
assert (s == "-42");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user