mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 08:48:30 +01:00
Set a default value for DIGITS
This commit is contained in:
@@ -46,7 +46,7 @@ namespace ArduinoJson
|
|||||||
content.asString = value;
|
content.asString = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int DIGITS>
|
template<int DIGITS=2>
|
||||||
void set(double value)
|
void set(double value)
|
||||||
{
|
{
|
||||||
printToImpl = &printDoubleTo<DIGITS>;
|
printToImpl = &printDoubleTo<DIGITS>;
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ namespace JsonGeneratorTests
|
|||||||
write("\t");
|
write("\t");
|
||||||
assertResultIs("\"\\t\"");
|
assertResultIs("\"\\t\"");
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
TEST_METHOD(DoubleDefaultDigits)
|
TEST_METHOD(DoubleDefaultDigits)
|
||||||
{
|
{
|
||||||
write(3.14159265358979323846);
|
write(3.14159265358979323846);
|
||||||
assertResultIs("3.14");
|
assertResultIs("3.14");
|
||||||
}*/
|
}
|
||||||
|
|
||||||
TEST_METHOD(DoubleZeroDigits)
|
TEST_METHOD(DoubleZeroDigits)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user