This commit is contained in:
jl777
2016-10-25 19:28:49 -03:00
parent 34c42c40eb
commit f3d5295c6d
2 changed files with 30 additions and 0 deletions

View File

@@ -707,6 +707,14 @@ int64_t get_cJSON_int(cJSON *json,char *field)
return(0);
}
int64_t conv_floatstr(char *numstr)
{
double val,corr;
val = atof(numstr);
corr = (val < 0.) ? -0.50000000001 : 0.50000000001;
return((int64_t)(val * SATOSHIDEN + corr));
}
int64_t _conv_cJSON_float(cJSON *json)
{
int64_t conv_floatstr(char *);