Turn the number into BCD (binary coded decimal) i.e.
12345 -> 0x01 0x23 0x45
then print out each nibble (four bits).
This is actually how it is done in MIOS (but in assembler). The "if"s remove the leading zeros. Anyway, if you know what printf is, you don’t need any more help than this ;D
I just noticed a bug in my code… the first two MIOS_LCD_PrintChar(‘.’); should be MIOS_LCD_PrintChar(’ ');
MIOS_HLP_Dec2BCD is what is used for all the MIOS_LCD_PrintBCD* functions, so it should work, if it does not then something else is wrong, maybe byte ordering?
Perhaps try MIOS_HLP_Dec2BCD and then MIOS_LCD_PrintHex to dump the BCD values for a range of inputs, try to find out how it is wrong.