String: changed default to 2 decimal digits
This commit is contained in:
parent
85b4bb185d
commit
f07c6f2a52
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue