mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-02 15:41:36 +02:00
formatting
This commit is contained in:
parent
ce7e6eeea0
commit
a8e11be069
@ -36,21 +36,16 @@ namespace Poco {
|
|||||||
|
|
||||||
std::string NumberFormatter::format(bool value, BoolFormat format)
|
std::string NumberFormatter::format(bool value, BoolFormat format)
|
||||||
{
|
{
|
||||||
switch(format)
|
switch (format)
|
||||||
{
|
{
|
||||||
default:
|
|
||||||
case FMT_TRUE_FALSE:
|
|
||||||
if (value == true)
|
|
||||||
return "true";
|
|
||||||
return "false";
|
|
||||||
case FMT_YES_NO:
|
case FMT_YES_NO:
|
||||||
if (value == true)
|
return value ? "yes" : "no";
|
||||||
return "yes";
|
|
||||||
return "no";
|
|
||||||
case FMT_ON_OFF:
|
case FMT_ON_OFF:
|
||||||
if (value == true)
|
return value ? "on" : "off";
|
||||||
return "on";
|
|
||||||
return "off";
|
default: // including FMT_TRUE_FALSE:
|
||||||
|
return value ? "true" : "false";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user