Hi all, On Tue, Jul 28, 2015 at 9:34 AM, Stanislav Malyshev <smalys...@gmail.com> wrote:
> > > > We can write > > > > $old = ini_set('precision', 17); > > json_encode($var); > > ini_set('precision', $old); > > > > everywhere to workaround this problem. > > If we're talking about encoding, that's what precision setting is - it > says how much we want to preserve in decimal encoding of float numbers. > Decoding, of course, should use whatever data available and not > truncate, but I understand that is already happening? > > > Question is "Is this the way it should be?". > > I don't see why not. That's exactly what precision setting is for, as > far as I can see. JSON is var exporter/importer like serialize/var_export. Both of serialize/var_export uses PG(serialize_precision), what's the point of _lose_ / _destroy_ original values while PHP could keep more precise values than now? Regards, -- Yasuo Ohgaki yohg...@ohgaki.net