Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.18.2

Bug #19543 comma breaks toCurrency
Submitted: 2012-08-03 22:53 UTC
From: bistromathics Assigned: kouber
Status: Closed Package: Numbers_Words
PHP Version: 5.3.10 OS: ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2012-08-03 22:53 UTC] bistromathics (Aaron Kennedy)
Description: ------------ What happens: "10,000" converts to "one hundred thousand dollars" Test script: --------------- echo Numbers_Words::toCurrency("10,000"); Expected result: ---------------- "10,000" converts to "ten thousand dollars"

Comments

 [2012-08-06 16:41 UTC] kouber (Kouber Saparev)
-Status: Open +Status: Verified
 [2014-01-23 18:29 UTC] kouber (Kouber Saparev)
-Status: Verified +Status: Closed -Assigned To: +Assigned To: kouber
The bug has been fixed in Git. A default decimal mark has been introduced, as well as custom decimal mark that you can optionally provide as 4th argument of the toCurrency() method. <? $number = "10,000.23"; # output = ten thousand dollars twenty-three cents echo Numbers_Words::toCurrency($number); # output = ten dollars zero cents echo Numbers_Words::toCurrency($number, 'en_US', 'USD', ','); ?>