Hello
I am at start of my journey whit Rust, and I am not able to convert a JSON number.
My JSON structure arrive from a TCL/TK form generator that write to stdout and is transferred to a Hash map:
let data = String::from_utf8(output.stdout)?;
println!("data:\n{}", data);
println!("status: {}", output.status);
let v:HashMap<String, Value> = serde_json::from_str(&data)?;
if v.contains_key("Integer") {
// let integer: f64 = from(v["Integer"]);
// let integer: f64 = v["Integer"]::Number;
// let integer: f64 = v["Integer"].as_f64();
// let integer = v["Integer"].as_f64();
println!("Sum:{}",v["Integer"]+v["Number"]+v["DecNumber"]);
}
all the instructions I tried (except the first one) report an error; in the case of the first, the error is on the addition operation.
Thanks