Browse Source

Use the percent util func in the string func. (#13523)

Marcio Teixeira 6 years ago
parent
commit
d992dfe7d5
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/core/utility.cpp

+ 1
- 1
Marlin/src/core/utility.cpp View File

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);

Loading…
Cancel
Save