mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
Add precision specifier for floating point numbers.
This commit is contained in:
parent
ef4a855b37
commit
7a9dcaacbe
2
third-party/cJSON/cJSON.c
vendored
2
third-party/cJSON/cJSON.c
vendored
@ -131,7 +131,7 @@ static char *print_number(cJSON *item)
|
|||||||
if (str)
|
if (str)
|
||||||
{
|
{
|
||||||
if (fabs(floor(d)-d)<=DBL_EPSILON) sprintf(str,"%.0f",d);
|
if (fabs(floor(d)-d)<=DBL_EPSILON) sprintf(str,"%.0f",d);
|
||||||
else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d);
|
else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%.16e",d);
|
||||||
else sprintf(str,"%f",d);
|
else sprintf(str,"%f",d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user