I an Arduino novice and I am trying to display the output of an AMS2320 temperature sensor on an M5StickC LCD.
I would like the decimal point to remain in a fixed position with one decimal place for all temperatures between -40 and +80 degrees C.
Right justify would work but I can't see how to do it.
I eventually came up with the format below which works but seems a but I'm not sure why.
The width defined by * and 5 seem to apply the number only and exclude the 'C.
The * in the format string specifies that the field width is given as a argument, in this case a field width of 5 with 1 decimal place. The OP could have written a format string of "TEMP %5.1f'C" instead. Presumably the character before the C could be a degree symbol.