pfi/pficommon — Issue #21: String represention of json_float should be dot notatino at integer.
Author: repeatedly
Created: 2012-01-31 05:54:37+00:00
State: open

stringnized result of json_float does not have '.' if json_float has integer value.

```cpp
std::vector vec;
vec.push_back(1.1);
vec.push_back(0);
vec.push_back(2.5);

std::ostringstream oss;
oss << pfi::text::json::to_json(vec);
std::cout << oss.str() << std::endl; // [1.1, 0, 2.5];
```

This format is not useful, bacause following code raises an exception.

```cpp
pfi::text::json::json j;
std::istringstream iss("[1.1,0,2.5]");
iss >> j;
std::vector arr;
try {
pfi::text::json::from_json(j, arr);
} catch (const std::exception& e) {
std::cout << e.what() << std::endl;
}
```

json_float should generate '.' notation.

### P.S.

In Ruby, to_json generates dot notation.

```ruby
{'hoge' => 1.0}.to_json #=> "{\"hoge\":1.0}"
```