Skip to content

floats deserializing as int #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
peteDDD opened this issue May 13, 2023 · 0 comments
Open

floats deserializing as int #3

peteDDD opened this issue May 13, 2023 · 0 comments

Comments

@peteDDD
Copy link

peteDDD commented May 13, 2023

the following floats in the JSON
"4MA": 0.0,
"20MA": 100.0

deserializes as ints
int s_420_1_4MA = s_420_1["4MA"]; // 0
int s_420_1_20MA = s_420_1["20MA"]; // 100

in the code coming out of the assistant.

more complete code:
"s_420_1": {
"Active": 0,
"SBS": 60,
"RPD": 0,
"Math": 1,
"DP": 2,
"4MA": 0.0,
"20MA": 100.0
}

JsonObject s_420_1 = doc["s_420_1"];
int s_420_1_Active = s_420_1["Active"]; // 0
int s_420_1_SBS = s_420_1["SBS"]; // 60
int s_420_1_RPD = s_420_1["RPD"]; // 0
int s_420_1_Math = s_420_1["Math"]; // 1
int s_420_1_DP = s_420_1["DP"]; // 2
int s_420_1_4MA = s_420_1["4MA"]; // 0
int s_420_1_20MA = s_420_1["20MA"]; // 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant