One approach would be to use sprintf(), itoa(), and the like to convert your values into ASCII strings (presumably without loss of accuracy), then perform string manipulations to insert comma-characters into the representations. (Hint: start with strchr()/index() to find the decimal point.)