Skip to content

Commit 0196d1e

Browse files
committed
[Cleanup] Fix parameter mismatch floating point formatting String
1 parent e6c8677 commit 0196d1e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/src/Helpers/Convert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ float ul2float(unsigned long ul)
234234
/*********************************************************************************************\
235235
Workaround for removing trailing white space when String() converts a float with 0 decimals
236236
\*********************************************************************************************/
237-
String toString(const float& value, uint8_t decimals)
237+
String toString(const float& value, unsigned int decimals)
238238
{
239239
String sValue = String(value, decimals);
240240

241241
sValue.trim();
242242
return sValue;
243243
}
244244

245-
String doubleToString(const double& value, int decimals, bool trimTrailingZeros) {
245+
String doubleToString(const double& value, unsigned int decimals, bool trimTrailingZeros) {
246246
String res(value, decimals);
247247
if (trimTrailingZeros) {
248248
int dot_pos = res.lastIndexOf('.');

src/src/Helpers/Convert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ float ul2float(unsigned long ul);
6565
/*********************************************************************************************\
6666
Workaround for removing trailing white space when String() converts a float with 0 decimals
6767
\*********************************************************************************************/
68-
String toString(const float& value, uint8_t decimals);
68+
String toString(const float& value, unsigned int decimals);
6969

70-
String doubleToString(const double& value, int decimals = 2, bool trimTrailingZeros = false);
70+
String doubleToString(const double& value, unsigned int decimals = 2, bool trimTrailingZeros = false);
7171

7272

7373
#endif // HELPERS_CONVERT_H

src/src/WebServer/Markup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ void addNumericBox(const String& id, int value, int min, int max)
669669

670670
#endif // ifdef ENABLE_TOOLTIPS
671671

672-
void addFloatNumberBox(const String& id, float value, float min, float max, uint8_t nrDecimals, float stepsize
672+
void addFloatNumberBox(const String& id, float value, float min, float max, unsigned int nrDecimals, float stepsize
673673
#ifdef ENABLE_TOOLTIPS
674674
, const String& tooltip
675675
#endif // ifdef ENABLE_TOOLTIPS

src/src/WebServer/Markup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void addFloatNumberBox(const String& id,
236236
float value,
237237
float min,
238238
float max,
239-
uint8_t nrDecimals = 6,
239+
unsigned int nrDecimals = 6,
240240
float stepsize = 0.0f
241241
#ifdef ENABLE_TOOLTIPS
242242
,

0 commit comments

Comments
 (0)