Currency Number Javascript Internationalization Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Currency Number Javascript Internationalization Tutorial

Currency Number Javascript Internationalization Tutorial

Our Internationalization quest continues. So, today, adding onto yesterdayโ€™s DateTime Javascript Internationalization Primer Tutorial โ€ฆ

โ€ฆ Javascript (ie. client) based Intl object web application functionality.

Thanks to these great resources โ€ฆ

  • Intl.NumberFormat
  • Current currency & funds code listโ€˜s
    1. download the linkโ€™s XLS zip resource โ€ฆ
    2. open with macOS Numbers desktop application here on this MacBook Pro โ€ฆ
    3. Export To โ€ฆ CSVโ€ฆ


      AFGHANISTAN,Afghani,AFN,971,2,,,

      ร…LAND ISLANDS,Euro,EUR,978,2,,,

      ALBANIA,Lek,ALL,008,2,,,

      ALGERIA,Algerian Dinar,DZD,012,2,,,

      AMERICAN SAMOA,US Dollar,USD,840,2,,,

      ANDORRA,Euro,EUR,978,2,,,

      ANGOLA,Kwanza,AOA,973,2,,,

      ANGUILLA,East Caribbean Dollar,XCD,951,2,,,

      ...


      โ€ฆ the first 8 lines of data looking as above
    4. at Terminal application command line using the resultant currencies.csv โ€ฆ


      $ cat currencies.csv | awk -F, '{ print "\<option data-ctyname=\"" $1 "\" data-cryname=\"" $2 "\" value=~ currency: \"" $3 "\" ~ data-crynumber=\"" $4 "\" data-minorunit=\"" $5 "\"\> currency: \"" $3 "\"\ (" $2 ")<\/option\>"; }' | tr "~" "'" > currencies.txt

      $ head -8 currencies.txt

      <option data-ctyname="AFGHANISTAN" data-cryname="Afghani" value=' currency: "AFN" ' data-crynumber="971" data-minorunit="2"> currency: "AFN" (Afghani)</option>

      <option data-ctyname="ร…LAND ISLANDS" data-cryname="Euro" value=' currency: "EUR" ' data-crynumber="978" data-minorunit="2"> currency: "EUR" (Euro)</option>

      <option data-ctyname="ALBANIA" data-cryname="Lek" value=' currency: "ALL" ' data-crynumber="008" data-minorunit="2"> currency: "ALL" (Lek)</option>

      <option data-ctyname="ALGERIA" data-cryname="Algerian Dinar" value=' currency: "DZD" ' data-crynumber="012" data-minorunit="2"> currency: "DZD" (Algerian Dinar)</option>

      <option data-ctyname="AMERICAN SAMOA" data-cryname="US Dollar" value=' currency: "USD" ' data-crynumber="840" data-minorunit="2"> currency: "USD" (US Dollar)</option>

      <option data-ctyname="ANDORRA" data-cryname="Euro" value=' currency: "EUR" ' data-crynumber="978" data-minorunit="2"> currency: "EUR" (Euro)</option>

      <option data-ctyname="ANGOLA" data-cryname="Kwanza" value=' currency: "AOA" ' data-crynumber="973" data-minorunit="2"> currency: "AOA" (Kwanza)</option>

      <option data-ctyname="ANGUILLA" data-cryname="East Caribbean Dollar" value=' currency: "XCD" ' data-crynumber="951" data-minorunit="2"> currency: "XCD" (East Caribbean Dollar)</option>

      ...


      โ€ฆ supplying many of the
    5. option elements of โ€œGlobal Changesโ€ select (dropdown) element currencies.txt needed manual edits via โ€œvi currencies.txtโ€ to modify and/or delete occasional records containing โ€œโ€ โ€ฆ
    6. copy the resultant modified currencies.txt content into our (howwe got there) intl_currencyโšซhtml code for the โ€œGlobalChangesโ€ dropdown element you can try with this liveโœ‚run link



Previous relevant DateTime Javascript Internationalization Primer Tutorial is shown below.

DateTime Javascript Internationalization Primer Tutorial

DateTime Javascript Internationalization Primer Tutorial

We wanted to visit the big I.T. topic area of Internationalization here today. Specifically, dates and times and how your Javascript can harness the โ€ฆ



Intl object

โ€ฆ functionality.

We found good for research here were, thanks to โ€ฆ

To then test some of this for yourself you can try our intl_useโšซhtmlโ€˜s proof of concept web application โ€ฆ or โ€ฆ

โ€ฆ the idea being you can learn about it by changing Javascript code examples yourselves.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *