It doesn’t do it in a particularly interesting way - the meat of this is implementing the itoa function (integer to array) that converts a number to a string. That implementation is itself not particularly special, just fairly condensed. Everything else is done with standard library functions