Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Yonatan Bergman

March 01, 2016
Tweet

More Decks by Yonatan Bergman

Other Decks in Technology

Transcript

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

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

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

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

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

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

    Name ▸ Subunit Name ▸ Exponent ▸ Symbol * ▸ IQD ▸ Iraqi Dinar ▸ Fils ▸ 3 [1/1000] ▸ د.ع IRAQI DINAR
  7. $ - 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
  8. $ - 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
  9. 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
  10. 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
  11. “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