s is a number from 0-9, and 48 is the ASCII character code of the character '0'. So s+48 converts 0-9 to '0'-'9' - this is done 3 times, once for the hundreds digit (so presumably test_final is in the range 0-999), once for the 10s and once for the units. If the first two are zero then it does lcd_cmd(0x06) instead, which I presume moves the cursor one step to the right, so that a value of 36 is not displayed as '036'.