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