{"id":34382,"date":"2017-11-19T03:01:50","date_gmt":"2017-11-18T17:01:50","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=34382"},"modified":"2017-11-18T20:04:57","modified_gmt":"2017-11-18T10:04:57","slug":"localized-currency-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/localized-currency-primer-tutorial\/","title":{"rendered":"Localized Currency Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/localized_currency.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Localized Currency Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/localized_currency.jpg\" title=\"Localized Currency Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Localized Currency Primer Tutorial<\/p><\/div>\n<p>Where &#8220;internationalization&#8221; and &#8220;localization&#8221; meet &#8220;web applications&#8221; a big subject is &#8220;currency&#8221;, in terms of how amounts of money are displayed in a country or region of interest.  In terms of this today we &#8220;channel&#8221; the Javascript functionality &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='Number.prototype.toLocaleString() information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Number\/toLocaleString'>numObj.toLocaleString([<i>locales<\/i> [, <i>options<\/i>]])<\/a>; \/\/ where <i>locales<\/i>=BCP 47 language tag and <i>options<\/i> is either (like) { style: 'decimal', maximumFractionDigits : 2, minimumFractionDigits : 2 } or (like) { style: 'currency', currency: 'AUD' }<br \/>\n<\/code><\/p>\n<p> &#8230; to combine &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Language Culture Codes' href='https:\/\/msdn.microsoft.com\/en-us\/library\/ee825488(v=cs.20).aspx'>Language Culture Codes<\/a> (BCP 47 language tags (is <i>locales<\/i> above)) to determine an International Keyboard character set to use\n<li><a target=_blank title='Currency Codes' href='http:\/\/www.nationsonline.org\/oneworld\/currencies.htm'>Currency Codes<\/a> (ISO 4217 currency codes (is part of <i>options<\/i> above))<\/li>\n<\/ul>\n<p> &#8230; into HTML <a target=_blank title='HTML select tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_select.asp'>select<\/a> &#8220;dropdown&#8221; elements, around the inspiration of this <a target=_blank title='https:\/\/jwcooney.com\/2016\/03\/26\/javascript-outputting-a-number-in-traditional-currency-format\/' href='https:\/\/jwcooney.com\/2016\/03\/26\/javascript-outputting-a-number-in-traditional-currency-format\/'>very useful link<\/a>, thanks, to piece together the user definable parameters to localize the currency representation of numbers in the user defined &#8220;local environment&#8221;.<\/p>\n<p>You can see this in play with today&#8217;s HTML and Javascript <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/localized_currency.html_GETME\" title=\"localized_currency.html\">localized_currency.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/localized_currency.html\" title=\"Click picture\">live run<\/a> link, that you can try yourself.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d34382' onclick='var dv=document.getElementById(\"d34382\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/currency\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d34382' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Where &#8220;internationalization&#8221; and &#8220;localization&#8221; meet &#8220;web applications&#8221; a big subject is &#8220;currency&#8221;, in terms of how amounts of money are displayed in a country or region of interest. In terms of this today we &#8220;channel&#8221; the Javascript functionality &#8230; numObj.toLocaleString([locales &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/localized-currency-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[1627,2392,2396,576,620,2395,652,673,2383,2394,997,2393,1319],"class_list":["post-34382","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-characters","tag-currency","tag-currency-code","tag-html","tag-internationalization","tag-iso","tag-javascript","tag-keyboard","tag-localization","tag-number","tag-programming","tag-tolocalestring","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34382"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=34382"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34382\/revisions"}],"predecessor-version":[{"id":34388,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/34382\/revisions\/34388"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=34382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=34382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=34382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}