Req #67718 [Opn]: Currency type

From: Date: Wed, 30 Jul 2014 18:26:22 +0000
Subject: Req #67718 [Opn]: Currency type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186892@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67718&edit=1 ID: 67718 Updated by: fa@php.net Reported by: dorin dot marcoci at gmail dot com Summary: Currency type Status: Open Type: Feature/Change Request Package: *Programming Data Structures PHP Version: master-Git-2014-07-30 (Git) Block user comment: N Private report: N New Comment: Just out of curiosity, where did you get the 4 decimals from? To be fair, the only time I had to do with currencies a lot was when we got EUR, and the official conversion rate from DM was to 5 digits. Then again, where would such a type live? As PHP is not strongly typed, it probably does not make sense to add some scalar like int/string. I don't think this makes a lot of sense, but if someone happens to be in the mood to implement something.. we'll see. Previous Comments: ------------------------------------------------------------------------ [2014-07-30 13:02:44] dorin dot marcoci at gmail dot com Description: ------------ Implement new type "Currency" as many other languages have it. It means fixed decimals (in most cases 4) and exact precision. Or to be more flexible Decimal datatype with default/optional precision. Internally to store these values as bigints. When operating with money values, floats suffers by definition and bcmath is little annoying. Want to use calculations/operators in a classical way. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67718&edit=1

« previous php.bugs (#186892) next »