Fix printing of floats in Hh_json
commit401c5f352d5f652b9a597742e1100ffaf8e40604
authorMarshall Roch <mroch@fb.com>
Mon, 15 Jun 2015 20:11:01 +0000 (15 13:11 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 15 Jun 2015 20:32:18 +0000 (15 13:32 -0700)
tree3ee5e59e4ebb219c8dec85ac415982c568974684
parent2ed649a2712109a1bdf39bb0ae450c03a7535b72
Fix printing of floats in Hh_json

Summary: Per RFC4627, floats must have a digit following the decimal point, and `NaN` and infinite values are forbidden. Right now we print things like `1.` because that's what `string_of_float` does, but it would need to be either `1` or `1.0`.

Reviewed By: @nmote

Differential Revision: D2153646
hphp/hack/src/utils/hh_json.ml