mirror of
https://github.com/emqx/neuron.git
synced 2026-10-22 01:05:56 +08:00
Merge pull request #765 from fengzeroz/main
fix(api): fix double type precision
This commit is contained in:
@@ -112,6 +112,7 @@ static void wrap_read_response_json(neu_resp_tag_value_t *tags, uint16_t len,
|
||||
case NEU_TYPE_DOUBLE:
|
||||
json->tags[i].t = NEU_JSON_DOUBLE;
|
||||
json->tags[i].value.val_double = tag->value.value.d64;
|
||||
json->tags[i].precision = tag->value.precision;
|
||||
break;
|
||||
case NEU_TYPE_BOOL:
|
||||
json->tags[i].t = NEU_JSON_BOOL;
|
||||
|
||||
@@ -153,6 +153,7 @@ void handle_read_resp(nng_aio *aio, neu_resp_read_group_t *resp)
|
||||
case NEU_TYPE_DOUBLE:
|
||||
api_res.tags[i].t = NEU_JSON_DOUBLE;
|
||||
api_res.tags[i].value.val_double = resp->tags[i].value.value.d64;
|
||||
api_res.tags[i].precision = resp->tags[i].value.precision;
|
||||
break;
|
||||
case NEU_TYPE_BIT:
|
||||
api_res.tags[i].t = NEU_JSON_BIT;
|
||||
|
||||
Reference in New Issue
Block a user