formatting

This commit is contained in:
Günter Obiltschnig 2021-04-14 19:25:03 +02:00
parent ce7e6eeea0
commit a8e11be069

View File

@ -38,19 +38,14 @@ 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";
} }
} }