Re: [RFC] Preserve Fractional Part in JSON encode

From: Date: Thu, 25 Dec 2014 23:17:47 +0000
Subject: Re: [RFC] Preserve Fractional Part in JSON encode
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-79950@lists.php.net to get a copy of this message
Andrea, I am not a specialist in float numbers, but I think integral float numbers have a fractional part with value 0. JSON_FLOAT_ADD_POINT_ZERO can be confuse for regular floats with non-zero as fractional part. Seems you are going to add a point zero in a regular float with point something. Anyway, I am open to rename the constant to make it clear for everyone. I just can't find a better name than that. By the way, this name was proposed by Kevin Israel (plstand) on the PR. On Thu, Dec 25, 2014 at 9:01 PM, Andrea Faulds <ajf@ajf.me> wrote: > > > On 25 Dec 2014, at 19:32, Juan Basso <jrbasso@gmail.com> wrote: > > > > The RFC can be found here: > > https://wiki.php.net/rfc/json_preserve_fractional_part > > Hey Juan, > > A further thought: is “Preserve Fractional Part” the best name? Integral > floats like float(12) don’t have any fractional part, and besides, the name > doesn’t tell you what it does IMO. Perhaps something like > JSON_FLOAT_ADD_POINT_ZERO? It’s more literal and, I think, more obvious. > > Thanks. > > -- > Andrea Faulds > http://ajf.me/ > > > > >

« previous php.internals (#79950) next »