Helper Functions
- Implemented rightJustifyZero for zero-padded integer strings.
This commit is contained in:
@@ -951,6 +951,14 @@ std::string leftJustify (const std::string& input, const int width)
|
||||
return input + std::string (width - utf8_text_length (input), ' ');
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string rightJustifyZero (const int input, const int width)
|
||||
{
|
||||
std::stringstream s;
|
||||
s << std::setw (width) << std::setfill ('0') << input;
|
||||
return s.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string rightJustify (const int input, const int width)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user