intridea/multi_json

Can we specify the precision in a Float data type?

cryptomatictrader opened this issue · 2 comments

I notice Float data type is rounded. Is there anyway to specify the precision in a Float data type when it is converted?

2.1.2 :001 > MultiJson.dump({:abc => 1405460727.723866})
 => "{\"abc\":1405460727.72387}" 
rwz commented

This behavior is specific to Oj adapter. I will file an issue to oj gem. For now you could use different adapter that doesnt't round floats.

rwz commented

The problem seems to be fixed in Oj 2.10.