Last active
June 1, 2022 00:28
-
-
Save Akira-Hayasaka/074a00ce98cf92eeb78f9d7eb57caed2 to your computer and use it in GitHub Desktop.
prepend zero
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string prepend_0(const int i, const int n_zero) | |
{ | |
return std::string(n_zero - std::min(n_zero, (int)ofToString(i).length()), '0') + ofToString(i); | |
} | |
auto prepend_0 = [&](const int i, const int n_zero) -> string | |
{ | |
return std::string(n_zero - std::min(n_zero, (int)ofToString(i).length()), '0') + ofToString(i); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment