MCPcopy Create free account
hub / github.com/Tracktion/choc / writeShortInteger

Method writeShortInteger

choc/text/choc_FloatToString.h:194–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192 static void writeDigitIfNotLeadingZero (char* dest, uint32_t& length, uint32_t digit) { if (digit != 0 || length != 0) dest[length++] = static_cast<char> (digit + '0'); }
193
194 [[nodiscard]] static char* writeShortInteger (char* dest, int n)
195 {
196 if (n < 0) return writeShortInteger (write (dest, '-'), -n);
197 if (n >= 100) return writeDigit (dest, n / 100, (n / 10) % 10, n % 10);
198 if (n >= 10) return writeDigit (dest, n / 10, n % 10);
199
200 return writeDigit (dest, n);
201 }
202
203 static void insertChar (char* dest, uint32_t length, char charToInsert, uint32_t numRepetitions)
204 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected