diff --git a/src/Motorradvermietung.cpp b/src/Motorradvermietung.cpp index 1893e3d..39382a4 100644 --- a/src/Motorradvermietung.cpp +++ b/src/Motorradvermietung.cpp @@ -25,6 +25,11 @@ T ask_question(const string& question) return value; } +/** + * \brief Returns true if answer was 'J'. False if user answered with 'N' + * \param question The question for user input. + * \return + */ bool ask_question(const string& question) { while (true) @@ -42,10 +47,16 @@ bool ask_question(const string& question) } } -auto int_to_string(const unsigned int value, const unsigned int numbers = 0) -> string +/** + * \brief Converts a int to string and fill up with '0' at first position. + * \param value the integer value. + * \param digits Number of digits to fill + * \return Formatted integer as string + */ +auto int_to_string(const unsigned int value, const unsigned int digits = 0) -> string { auto str = to_string(value); - const auto len = numbers > str.length() ? numbers - str.length() : 0; + const auto len = digits > str.length() ? digits - str.length() : 0; for (unsigned int i = 0; i < len; ++i) { str.insert(0, "0");