First question is why you would ever want to suppress the leading 0 when the value is less than 1?
Adding the commas is a rather manual process. You need to divide the value by 1000 to get the part before the comma (24845 / 1000 = 24), then use the % operator to get the part after the comma (24845 % 1000 = 845), then print the first value, then print the comma, then print the 2nd value.
That works for ints, so you need to convert the float to an int. Then, subtract the int from the float (24845.387 - 24845 = 0.387). Then, multiply by 100.0 and add 0.5 to round the value off, and store as another int (0.387 * 100 = 38.7; 38.7 + 0.5 = 39.2; 39.2 as an int is 39). Then, if the int is less than 10 print a 0 and the int. Otherwise, print the int.
Printing 24, comma, 845, point, 39 will show you 24,845.39 which is 24845.387 to two decimal places.