MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / String_AppendPaddedInt

Function String_AppendPaddedInt

src/String.c:192–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void String_AppendPaddedInt(cc_string* str, int num, int minDigits) {
193 char digits[STRING_INT_CHARS];
194 int i, count;
195 for (i = 0; i < minDigits; i++) { digits[i] = '0'; }
196
197 count = String_MakeUInt32(num, digits);
198 if (count < minDigits) count = minDigits;
199
200 for (i = count - 1; i >= 0; i--) {
201 String_Append(str, digits[i]);
202 }
203}
204
205void String_AppendFloat(cc_string* str, float num, int fracDigits) {
206 int i, whole, digit;

Callers 1

String_Format4Function · 0.85

Calls 2

String_MakeUInt32Function · 0.85
String_AppendFunction · 0.85

Tested by

no test coverage detected