Added overload to add() to specify the double precision

This commit is contained in:
Benoît Blanchon
2014-07-03 13:45:53 +02:00
parent 5b1c2047a4
commit daba65d987
4 changed files with 34 additions and 21 deletions

View File

@ -23,6 +23,11 @@ public:
add(JsonValue(value));
}
void add(double value, int digits=2)
{
add(JsonValue(value, digits));
}
void add(JsonValue value)
{
if (itemCount >= N) return;

View File

@ -23,6 +23,11 @@ public:
add(key, JsonValue(value));
}
void add(const char* key, double value, int digits=2)
{
add(key, JsonValue(value, digits));
}
void add(const char* key, JsonValue value)
{
if (itemCount >= N) return;