Re: [RFC] Preserve Fractional Part in JSON encode

From: Date: Thu, 08 Jan 2015 00:14:50 +0000
Subject: Re: [RFC] Preserve Fractional Part in JSON encode
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-80260@lists.php.net to get a copy of this message
I really like the new name and the consistence with the rest of php. If no one else has a complain about it I will update the RFC and open for voting, right? Juan Basso On Jan 5, 2015 7:31 AM, "Ferenc Kovacs" <tyra3l@gmail.com> wrote: > > > On Mon, Jan 5, 2015 at 5:18 AM, Juan Basso <jrbasso@gmail.com> wrote: > >> Hi, >> >> Everyone has any concern on the constant name as Andrea mentioned? Should >> we keep or rename it? If this name is fine and there is no other concerns >> probably in 3 days (when completes 2 weeks) this RFC can be moved to >> voting, right? >> >> >> Thanks, >> Juan Basso >> > > I prefer the originally proposed constant name > (JSON_PRESERVE_FRACTIONAL_PART) over JSON_FLOAT_ADD_POINT_ZERO. > I've did a quick check and we have a constant called > FILTER_FLAG_ALLOW_FRACTION so maybe JSON_PRESERVE_FRACTION would be a bit > simpler and consistent. > But that would still imply that without this option we truncate (non-zero) > fractional parts, so maybe something like JSON_PRESERVE_ZERO_FRACTION. > I think PRESERVE is better than ADD because we aren't really adding > something but making sure that it won't be lost through the json_encode. > > -- > Ferenc Kovács > @Tyr43l - http://tyrael.hu >

« previous php.internals (#80260) next »