|
|
|
|
59
|
|
59
|
|
60
|
// Convert a full-range unsigned 8bit int to a percentage
|
60
|
// Convert a full-range unsigned 8bit int to a percentage
|
61
|
char* ui8tostr_percent(const uint8_t i) {
|
61
|
char* ui8tostr_percent(const uint8_t i) {
|
62
|
- const uint16_t percent = 100 * i / 255;
|
|
|
|
|
62
|
+ const uint8_t percent = ui8_to_percent(i);
|
63
|
conv[3] = RJDIGIT(percent, 100);
|
63
|
conv[3] = RJDIGIT(percent, 100);
|
64
|
conv[4] = RJDIGIT(percent, 10);
|
64
|
conv[4] = RJDIGIT(percent, 10);
|
65
|
conv[5] = DIGIMOD(percent, 1);
|
65
|
conv[5] = DIGIMOD(percent, 1);
|