{"action":"created","issue":{"url":"https://api.github.com/repos/e-ig/standards/issues/3","labels_url":"https://api.github.com/repos/e-ig/standards/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/e-ig/standards/issues/3/comments","events_url":"https://api.github.com/repos/e-ig/standards/issues/3/events","html_url":"https://github.com/e-ig/standards/pull/3","id":93953859,"number":3,"title":"[RFC] Proposal for a currency specification","user":{"login":"jpgerdeman","id":1579014,"avatar_url":"https://avatars.githubusercontent.com/u/1579014?v=3","gravatar_id":"","url":"https://api.github.com/users/jpgerdeman","html_url":"https://github.com/jpgerdeman","followers_url":"https://api.github.com/users/jpgerdeman/followers","following_url":"https://api.github.com/users/jpgerdeman/following{/other_user}","gists_url":"https://api.github.com/users/jpgerdeman/gists{/gist_id}","starred_url":"https://api.github.com/users/jpgerdeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpgerdeman/subscriptions","organizations_url":"https://api.github.com/users/jpgerdeman/orgs","repos_url":"https://api.github.com/users/jpgerdeman/repos","events_url":"https://api.github.com/users/jpgerdeman/events{/privacy}","received_events_url":"https://api.github.com/users/jpgerdeman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-09T04:42:03Z","updated_at":"2015-07-16T17:15:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/e-ig/standards/pulls/3","html_url":"https://github.com/e-ig/standards/pull/3","diff_url":"https://github.com/e-ig/standards/pull/3.diff","patch_url":"https://github.com/e-ig/standards/pull/3.patch"},"body":"Proposal as a base of discussion.\r\n\r\nSee [discussion on mailing list](https://groups.google.com/forum/#!topic/e-ig/s7788AQitGg)\r\n\r\n### Extra information\r\n\r\nComparison with Proposed Currency Interface\r\n\r\nProposed Currency |  | [Sylius](https://github.com/Sylius/Sylius/blob/0c15f8353e5c70817d7d4d23c5ff53eccd4f8015/src/Sylius/Component/Currency/Model/CurrencyInterface.php) | [Drupal Commerce](https://github.com/commerceguys/intl/blob/master/src/Currency/CurrencyInterface.php) | [Elcodi](https://github.com/elcodi/elcodi/blob/26c7e764f5553d341d7f0cea85c22228a0648d27/src/Elcodi/Component/Currency/Entity/Interfaces/CurrencyInterface.php) | [opencart](https://github.com/opencart/opencart/blob/254ab46051fb3cc936c8c5327909e319e3d9ca99/upload/system/library/currency.php) | [Magento2](https://github.com/magento/magento2/blob/c02881213836394eeb3873c30cec8736a988796c/lib/internal/Magento/Framework/CurrencyInterface.php) | [MathiasVerraes](https://github.com/mathiasverraes/money/blob/nextrelease/src/Currency.php) | [SebastianBergmann](https://github.com/sebastianbergmann/money/blob/master/src/Currency.php) | [Java Currency Standard](https://docs.oracle.com/javase/8/docs/api/java/util/Currency.html)\r\n-------------------|---|---------|------------------|---------|-----------|-----------|-----------------|--------------------|------------------------\r\ngetAlphabeticCode |  | getCode | getCurrencyCode | getIso | getCode |  | getCode | getCurrencyCode | getCurrencyCode\r\n getName                  |  | getName | getName | getName |  | getName | getName | getDisplayName | getDisplayName\r\n getNumericCode             |  |  | getNumericCode |  |  |  |  | getNumericCode | getNumericCode\r\n getSymbol                |  |  | getSymbol | getSymbol | getSymbolRight/getSymbolLeft | getSymbol |  |  | getSymbol\r\n getMinorUnit               |  |  | getFractionDigits |  | getDecimalPlace |  |  | getDefaulFractionDigits | getDefaulFractionDigits\r\n getCountries      |  |  |  |  |  |  |  |  | \r\n |  | setCode | setCurrencyCode | setIso |  | getRegionList |  |  | \r\n |  | setName | setName | setName |  |  |  |  | \r\n |  |  | setnumericCode |  |  |  |  |  | \r\n |  |  | setSymbol | setSymbol |  |  |  |  | \r\n |  |  | setFractionDigits |  |  |  |  |  | \r\n |  |  |  |  |  |  |  | getSubUnit (how manny cents to a dollar) | \r\n |  |  |  |  |  | getShortName |  |  | \r\n\r\n\r\nComparison with Proposed Currency Repository\r\n\r\nProposed CurrencyRepository | [Sylius](https://github.com/Sylius/Sylius/blob/0c15f8353e5c70817d7d4d23c5ff53eccd4f8015/src/Sylius/Component/Currency/Model/CurrencyInterface.php) | [Drupal Commerce](https://github.com/commerceguys/intl/blob/master/src/Currency/CurrencyInterface.php) | [Elcodi](https://github.com/elcodi/elcodi/blob/26c7e764f5553d341d7f0cea85c22228a0648d27/src/Elcodi/Component/Currency/Entity/Interfaces/CurrencyInterface.php) | [opencart](https://github.com/opencart/opencart/blob/254ab46051fb3cc936c8c5327909e319e3d9ca99/upload/system/library/currency.php) | [Magento2](https://github.com/magento/magento2/blob/c02881213836394eeb3873c30cec8736a988796c/lib/internal/Magento/Framework/CurrencyInterface.php) | [MathiasVerraes](https://github.com/mathiasverraes/money/blob/nextrelease/src/Currency.php) | [SebastianBergmann](https://github.com/sebastianbergmann/money/blob/master/src/Currency.php) | [Java Currency Standard](https://docs.oracle.com/javase/8/docs/api/java/util/Currency.html)\r\n-----------------------------|---------|------------------|---------|-----------|-----------|-----------------|--------------------|------------------------\r\nretrieveByAlphabeticCode |  |  |  |  |  |  |  | getInstance\r\nretrieveByNumericCode |  |  |  |  |  |  |  | \r\nretrieveByCountryCode |  |  |  |  |  |  |  | getInstance\r\nretrieveAll |  |  |  |  | getCurrencyList |  | getCurrencies | getAvailableCurrencies\r\n |  |  |  | has |  |  |  | \r\n |  |  |  |  | getCache |  |  | \r\n |  |  |  |  | hasCache |  |  | \r\n |  |  |  |  | setCache |  |  | \r\n |  |  |  |  | removeChache |  |  | \r\n |  |  |  |  | clearCache |  |  | \r\n |  |  |  |  |  |  | addCurrency | \r\n\r\nComparison of the complete interfaces\r\n\r\nProposed Currency | Proposed CurrencyRepository | [Sylius](https://github.com/Sylius/Sylius/blob/0c15f8353e5c70817d7d4d23c5ff53eccd4f8015/src/Sylius/Component/Currency/Model/CurrencyInterface.php) | [Drupal Commerce](https://github.com/commerceguys/intl/blob/master/src/Currency/CurrencyInterface.php) | [Elcodi](https://github.com/elcodi/elcodi/blob/26c7e764f5553d341d7f0cea85c22228a0648d27/src/Elcodi/Component/Currency/Entity/Interfaces/CurrencyInterface.php) | [opencart](https://github.com/opencart/opencart/blob/254ab46051fb3cc936c8c5327909e319e3d9ca99/upload/system/library/currency.php) | [Magento2](https://github.com/magento/magento2/blob/c02881213836394eeb3873c30cec8736a988796c/lib/internal/Magento/Framework/CurrencyInterface.php) | [MathiasVerraes](https://github.com/mathiasverraes/money/blob/nextrelease/src/Currency.php) | [SebastianBergmann](https://github.com/sebastianbergmann/money/blob/master/src/Currency.php) | [Java Currency Standard](https://docs.oracle.com/javase/8/docs/api/java/util/Currency.html)\r\n-------------------|------------------------------|---------|------------------|---------|-----------|-----------|-----------------|--------------------|------------------------\r\n | retrieveByAlphabeticCode |  |  |  |  |  |  |  | getInstance\r\n | retrieveByNumericCode |  |  |  |  |  |  |  | \r\n | retrieveByCountryCode |  |  |  |  |  |  |  | getInstance\r\n | retrieveAll |  |  |  |  | getCurrencyList |  | getCurrencies | getAvailableCurrencies\r\n |  |  |  |  | has |  |  |  | \r\n |  |  |  |  |  | getCache |  |  | \r\n |  |  |  |  |  | hasCache |  |  | \r\n |  |  |  |  |  | setCache |  |  | \r\n |  |  |  |  |  | removeChache |  |  | \r\n |  |  |  |  |  | clearCache |  |  | \r\n |  |  |  |  |  |  |  | addCurrency | \r\n |  |  |  |  |  |  |  |  | \r\ngetAlphabeticCode |  | getCode | getCurrencyCode | getIso | getCode |  | getCode | getCurrencyCode | getCurrencyCode\r\n getName                  |  | getName | getName | getName |  | getName | getName | getDisplayName | getDisplayName\r\n getNumericCode             |  |  | getNumericCode |  |  |  |  | getNumericCode | getNumericCode\r\n getSymbol                |  |  | getSymbol | getSymbol | getSymbolRight/getSymbolLeft | getSymbol |  |  | getSymbol\r\n getMinorUnit               |  |  | getFractionDigits |  | getDecimalPlace |  |  | getDefaulFractionDigits | getDefaulFractionDigits\r\n getCountries      |  |  |  |  |  |  |  |  | \r\n |  | setCode | setCurrencyCode | setIso |  | getRegionList |  |  | \r\n |  | setName | setName | setName |  |  |  |  | \r\n |  |  | setnumericCode |  |  |  |  |  | \r\n |  |  | setSymbol | setSymbol |  |  |  |  | \r\n |  |  | setFractionDigits |  |  |  |  |  | \r\n |  |  |  |  |  |  |  | getSubUnit (how manny cents to a dollar) | \r\n |  |  |  |  |  | getShortName |  |  | \r\n |  |  |  |  |  |  | isAvailableWithin |  | \r\n |  |  |  |  |  |  |  |  | \r\n |  | getExchangeRate |  |  |  |  |  |  | \r\n |  | setExchangeRate |  |  |  |  |  |  | \r\n |  |  |  |  |  | setService (ExchangeService) |  |  | \r\n |  |  |  |  |  | getService (ExchangeService) |  |  | \r\n |  | setEnabled |  |  |  |  |  |  | \r\n |  | isEnabled |  |  |  |  |  |  | \r\n |  |  |  |  | format | toCurrency |  |  | \r\n |  |  |  |  |  | setFormat |  |  | \r\n |  |  |  |  |  | toString | __toString | __toString | toString\r\n |  |  |  |  |  |  | jsonSerialize |  | \r\n |  |  |  |  | convert |  |  |  | \r\n |  |  |  |  | getValue | getValue |  |  | \r\n |  |  |  |  |  | setValue |  |  | \r\n |  |  |  |  |  | getLocale |  |  | \r\n |  |  |  |  |  | setLocale |  |  | \r\n |  |  |  |  |  |  |  |  | \r\n |  |  |  |  |  | add |  |  | \r\n |  |  |  |  |  | sub |  |  | \r\n |  |  |  |  |  | div |  |  | \r\n |  |  |  |  |  | mul |  |  | \r\n |  |  |  |  |  | mod |  |  | \r\n |  |  |  |  |  | compare |  |  | \r\n |  |  |  |  |  | equals | equals |  | \r\n |  |  |  |  |  | isMore |  |  | \r\n |  |  |  |  |  | isLess |  |  | \r\n"},"comment":{"url":"https://api.github.com/repos/e-ig/standards/issues/comments/122025563","html_url":"https://github.com/e-ig/standards/pull/3#issuecomment-122025563","issue_url":"https://api.github.com/repos/e-ig/standards/issues/3","id":122025563,"user":{"login":"jpgerdeman","id":1579014,"avatar_url":"https://avatars.githubusercontent.com/u/1579014?v=3","gravatar_id":"","url":"https://api.github.com/users/jpgerdeman","html_url":"https://github.com/jpgerdeman","followers_url":"https://api.github.com/users/jpgerdeman/followers","following_url":"https://api.github.com/users/jpgerdeman/following{/other_user}","gists_url":"https://api.github.com/users/jpgerdeman/gists{/gist_id}","starred_url":"https://api.github.com/users/jpgerdeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpgerdeman/subscriptions","organizations_url":"https://api.github.com/users/jpgerdeman/orgs","repos_url":"https://api.github.com/users/jpgerdeman/repos","events_url":"https://api.github.com/users/jpgerdeman/events{/privacy}","received_events_url":"https://api.github.com/users/jpgerdeman/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T17:15:21Z","updated_at":"2015-07-16T17:15:21Z","body":"@sagikazarmark I updated the table the table in the opening post. The smaller table might've been confusing.\r\n\r\nRegarding points 2 and 3: I agree. That's why they are not part of the proposal.\r\n\r\nRegarding point 1. \r\n- Not even all real world currencies have a symbol. In which case getSymbol should return the Alphabetic code.\r\n- MinorUnits is needed, because not every currency is divisible by 100 (e.g. 100 cents to the dollar). Some don't even have a smaller currency.\r\n\r\n@matthiasverraes's Implementation was news to me. Thanks for that."}}