Boost logo

Boost Users :

From: Markus Pieper (onkelhotte_at_[hidden])
Date: 2023-02-24 09:20:24


Hi there,

I convert a std::vector<std::vector<float>> to a JSON string. Basically it
works, but the format is scientific:
"[[1.017E3,1.017E3,1.017E3 ... ]]"

My method looks now like this:

std::string Class::convertFieldAsJSON(std::vector<std::vector<float>> field) {
  return boost::json::serialize(boost::json::value_from(field));
}

It works, but my colleagues want to see a 1017 and not 1.017E3 in the output.
Is there a way to format the string?

Thanks in advance,
Markus



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net