Save 37% off PRO during our Black Friday Sale! »

Currencies, Computers & PHP

Currencies, Computers & PHP

A short lightning talk about money and currencies, tales of supporting a truly global application and the pitfalls you should be aware when handling money in code.

2f7eb8e439ce2d288dcfa240b5210664?s=128

Yonatan Bergman

March 01, 2016
Tweet

Transcript

  1. CURRENCIES,
 COMPUTERS & PHP* @YONBERGMAN

  2. @YONBERGMAN YONATAN BERGMAN

  3. None
  4. 26 PRIMARY MARKETS 17+ LANGUAGE 25 CURRENCIES 140 COUNTRIES

  5. CURRENCIES,
 COMPUTERS & PHP* @YONBERGMAN

  6. 3.50 $

  7. 3.50 $ CURRENCY AMOUNT MONEY VALUE

  8. $ € £ ¥ ₪ Ũ ₩ ₱ ŧ ฿

    $ € £ ¥ ₪ Ũ ₩ ₱ ŧ ฿ $ € £ ¥ ₪ Ũ ₩ ₱ ŧ ฿ CURRENCIES
  9. CURRENCY ▸ Currency Code (3 Letter - ISO 4217) ▸

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol *
  10. CURRENCY ▸ Currency Code (3 Letter - ISO 4217) ▸

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol * ▸ USD ▸ US Dollars ▸ Cents ▸ 2 [1/100] ▸ $ DOLLARS
  11. CURRENCY ▸ Currency Code (3 Letter - ISO 4217) ▸

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol * ▸ ILS ▸ Israeli Shekel ▸ Agorot ▸ 2 [1/100] ▸ ₪ ISRAELI SHEKEL
  12. CURRENCY ▸ Currency Code (3 Letter - ISO 4217) ▸

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol * ▸ JPY ▸ Japanese Yen ▸ SEN ▸ 0 [1/1] ▸ ¥ JAPANESE YEN
  13. CURRENCY ▸ Currency Code (3 Letter - ISO 4217) ▸

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol * ▸ IQD ▸ Iraqi Dinar ▸ Fils ▸ 3 [1/1000] ▸ د.ع IRAQI DINAR
  14. $ - Dollar € - Euro £ - British Pounds

    ¥ - Japanese yen ₪ - Israeli new shekel R$ - Brazilian real Ũ - Indian rupee ₩ - North Korean won ₱ - Philippine peso ŧ - Ukrainian hryvnia ฿ - Thai baht CHF - Swiss Franc
  15. $ - Dollar € - Euro £ - British Pounds

    ¥ - Japanese yen ₪ - Israeli new shekel R$ - Brazilian real Ũ - Indian rupee ₩ - North Korean won ₱ - Philippine peso ŧ - Ukrainian hryvnia ฿ - Thai baht CHF - Swiss Franc
  16. DEV TIPS ▸ Always save as Integer ▸ Always associate

    with Currency ▸ Never Compare values with different currencies ▸ Use the associated exponent to format the amount $3.50 = 350 USD $3.50 != £3.50
  17. FORMATTING

  18. FORMATTING SYMBOL ISOCODE INTERNATIONAL PLURAL $3.50 3.50 USD $3.50 USD

    3.50 DOLLARS ACCOUNTING $3.50 ($3.50)
  19. $3,500.50 en_US fr_FR 3 500,50 $ LOCALES

  20. 360 451 996 007,42 € Bulgarian, Czech, Estonian, Finnish, French,

    Italian, Lithuanian, Polish, Portuguese, Slovak, Swedish 360.451.996.007,42 € Croatian, Danish, Dutch (Belgium), German (Germany), Greek, Romanian, Slovenian, Spanish € 360.451.996.007,42 Dutch (Netherlands), German (Austria) €360,451,996,007.42 English (UK), Irish, Maltese 360 451 996 007,42 EUR Hungarian €360 451 996 007,42 Latvian € EUROS
  21. GITHUB.COM/RUBYMONEY/MONEY

  22. “WHEN I WAS YOUNG I THOUGHT THAT MONEY WAS THE

    MOST IMPORTANT THING IN LIFE; NOW THAT I AM OLD I KNOW THAT IT IS.” Oscar Wilde
  23. THANK YOU @YONBERGMAN

  24. ₱ Philippine peso= PHP