Skip to content

Commit f57a00e

Browse files
committed
String: changed default to 2 decimal digits
1 parent d101bf5 commit f57a00e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

hardware/arduino/avr/cores/arduino/WString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ unsigned char String::concat(unsigned long num)
325325
unsigned char String::concat(float num)
326326
{
327327
char buf[20];
328-
char* string = dtostrf(num, 8, 6, buf);
328+
char* string = dtostrf(num, 8, 2, buf);
329329
return concat(string, strlen(string));
330330
}
331331

332332
unsigned char String::concat(double num)
333333
{
334334
char buf[20];
335-
char* string = dtostrf(num, 8, 6, buf);
335+
char* string = dtostrf(num, 8, 2, buf);
336336
return concat(string, strlen(string));
337337
}
338338

hardware/arduino/avr/cores/arduino/WString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class String
6969
explicit String(unsigned int, unsigned char base=10);
7070
explicit String(long, unsigned char base=10);
7171
explicit String(unsigned long, unsigned char base=10);
72-
explicit String(float, int decimalPlaces=6);
73-
explicit String(double, int decimalPlaces=6);
72+
explicit String(float, int decimalPlaces=2);
73+
explicit String(double, int decimalPlaces=2);
7474
~String(void);
7575

7676
// memory management

hardware/arduino/avr/cores/robot/WString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,14 @@ unsigned char String::concat(unsigned long num)
325325
unsigned char String::concat(float num)
326326
{
327327
char buf[20];
328-
char* string = dtostrf(num, 8, 6, buf);
328+
char* string = dtostrf(num, 8, 2, buf);
329329
return concat(string, strlen(string));
330330
}
331331

332332
unsigned char String::concat(double num)
333333
{
334334
char buf[20];
335-
char* string = dtostrf(num, 8, 6, buf);
335+
char* string = dtostrf(num, 8, 2, buf);
336336
return concat(string, strlen(string));
337337
}
338338

hardware/arduino/avr/cores/robot/WString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class String
6969
explicit String(unsigned int, unsigned char base=10);
7070
explicit String(long, unsigned char base=10);
7171
explicit String(unsigned long, unsigned char base=10);
72-
explicit String(float, int decimalPlaces=6);
73-
explicit String(double, int decimalPlaces=6);
72+
explicit String(float, int decimalPlaces=2);
73+
explicit String(double, int decimalPlaces=2);
7474
~String(void);
7575

7676
// memory management

hardware/arduino/sam/cores/arduino/WString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,14 @@ unsigned char String::concat(unsigned long num)
326326
unsigned char String::concat(float num)
327327
{
328328
char buf[20];
329-
char* string = dtostrf(num, 8, 6, buf);
329+
char* string = dtostrf(num, 8, 2, buf);
330330
return concat(string, strlen(string));
331331
}
332332

333333
unsigned char String::concat(double num)
334334
{
335335
char buf[20];
336-
char* string = dtostrf(num, 8, 6, buf);
336+
char* string = dtostrf(num, 8, 2, buf);
337337
return concat(string, strlen(string));
338338
}
339339

hardware/arduino/sam/cores/arduino/WString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class String
6969
explicit String(unsigned int, unsigned char base=10);
7070
explicit String(long, unsigned char base=10);
7171
explicit String(unsigned long, unsigned char base=10);
72-
explicit String(float, int decimalPlaces=6);
73-
explicit String(double, int decimalPlaces=6);
72+
explicit String(float, int decimalPlaces=2);
73+
explicit String(double, int decimalPlaces=2);
7474
~String(void);
7575

7676
// memory management

0 commit comments

Comments
 (0)