1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2025-05-21 23:21:15 +02:00

feat: add string_zero_pad

This commit is contained in:
2024-09-12 12:31:58 +02:00
parent 35b868d0c1
commit c49d5f5421
4 changed files with 34 additions and 0 deletions

View File

@ -298,4 +298,16 @@ size_t string_last_position_of(const string_t string, const char character);
*/
string_t string_pad_start(const string_t string, const string_t pad_string, size_t target_length);
/**
* @brief Pad a number with zeros.
*
* @param number
* @param places
* @return string_t
* @example zero_pad(1, 2) // "01"
* @example zero_pad(10, 2) // "10"
* @since vTODO
*/
string_t string_zero_pad(uint64_t number, size_t places);
#endif