mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
String: changed default to 2 decimal digits
This commit is contained in:
parent
382fe3a080
commit
37825c1711
@ -325,14 +325,14 @@ unsigned char String::concat(unsigned long num)
|
||||
unsigned char String::concat(float num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
unsigned char String::concat(double num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,8 @@ public:
|
||||
explicit String(unsigned int, unsigned char base=10);
|
||||
explicit String(long, unsigned char base=10);
|
||||
explicit String(unsigned long, unsigned char base=10);
|
||||
explicit String(float, int decimalPlaces=6);
|
||||
explicit String(double, int decimalPlaces=6);
|
||||
explicit String(float, int decimalPlaces=2);
|
||||
explicit String(double, int decimalPlaces=2);
|
||||
~String(void);
|
||||
|
||||
// memory management
|
||||
|
@ -325,14 +325,14 @@ unsigned char String::concat(unsigned long num)
|
||||
unsigned char String::concat(float num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
unsigned char String::concat(double num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,8 @@ public:
|
||||
explicit String(unsigned int, unsigned char base=10);
|
||||
explicit String(long, unsigned char base=10);
|
||||
explicit String(unsigned long, unsigned char base=10);
|
||||
explicit String(float, int decimalPlaces=6);
|
||||
explicit String(double, int decimalPlaces=6);
|
||||
explicit String(float, int decimalPlaces=2);
|
||||
explicit String(double, int decimalPlaces=2);
|
||||
~String(void);
|
||||
|
||||
// memory management
|
||||
|
@ -326,14 +326,14 @@ unsigned char String::concat(unsigned long num)
|
||||
unsigned char String::concat(float num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
unsigned char String::concat(double num)
|
||||
{
|
||||
char buf[20];
|
||||
char* string = dtostrf(num, 8, 6, buf);
|
||||
char* string = dtostrf(num, 8, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,8 @@ public:
|
||||
explicit String(unsigned int, unsigned char base=10);
|
||||
explicit String(long, unsigned char base=10);
|
||||
explicit String(unsigned long, unsigned char base=10);
|
||||
explicit String(float, int decimalPlaces=6);
|
||||
explicit String(double, int decimalPlaces=6);
|
||||
explicit String(float, int decimalPlaces=2);
|
||||
explicit String(double, int decimalPlaces=2);
|
||||
~String(void);
|
||||
|
||||
// memory management
|
||||
|
Loading…
Reference in New Issue
Block a user