| 525 | |
| 526 | namespace { |
| 527 | std::string doubleToString(double d) { |
| 528 | std::ostringstream str; |
| 529 | str.imbue(std::locale::classic()); |
| 530 | const std::streamsize max_digits10 = 2 + std::numeric_limits<double>::digits10; |
| 531 | str.precision(max_digits10); |
| 532 | str << d; |
| 533 | return str.str(); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | // Convert the given double to a JSON string, which is either the number, |