|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-04-09 14:46 UTC] a dot schilder at gmx dot de
Description: ------------ In my tests I recognized that the currency code for Mauritania returned by \NumberFormatter::getSymbol() is 'MRO', although it was changed to 'MRU' from Janauary 1st 2018 (see: https://www.currency-iso.org/dam/isocy/downloads/dl_currency_iso_amendment_165.pdf). If you look into the Unicode CLDR, the code there is still set to 'MRO', so the question for me is: What is used as the base for the 'international currency symbol'? When it's ISO 4217 (as I'd expect), the code returned is wrong and should be corrected. If it's based on the Unicode CLDR data, the code is (currently) correct - but unexpected. In any case the used base for the currency symbol should be documented - so feel free to change this to a documentation bug if the Unicode data are used. Test script: --------------- <?php $formatter = new \NumberFormatter('*_MR', \NumberFormatter::CURRENCY); $currency = $formatter->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL); echo $currency; Expected result: ---------------- MRU Actual result: -------------- MRO PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Mar 17 04:00:01 2026 UTC |
Thank you very much, that clarified it. In the ICU documentation I read that the ISO currency code is used ("In ICU and Java, the currency is specified in the form of a 3-letter ISO 4217 code.") and therefore it's what I expected. I didn't know that ICU relies completely on the CLDR and their updates. Also, following the introduction for the intl extension, PHP not only uses the ICU data, but also other data (for example the Olson timezone DB). So for me it wasn't clear, if the value is correct (based on the lib version) or not.