{"id":19793,"date":"2014-04-11T18:01:53","date_gmt":"2014-04-11T10:01:53","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=19793"},"modified":"2025-04-04T01:44:08","modified_gmt":"2025-04-03T17:44:08","slug":"jquery-accounting-js","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/","title":{"rendered":"How to Use Accounting.js for Effective Number Formatting"},"content":{"rendered":"<p>On the internet, we often see numbers representing unread messages, comments, likes, and tweets, among other things. But when it comes to the precise demands of a financial institution or bank, displaying numbers can be a bit more complicated.<\/p>\n<p>For those who need numbers presented in a <strong>currency format or separated by commas and decimal points<\/strong>, the JavaScript library <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.npmjs.com\/package\/accounting-js\">Accounting.js<\/a> can be a fantastic tool for money and currency formatting.<\/p>\n<p>In this article, we\u2019ll explore some basic functionalities of Accounting.js and then demonstrate its practical use with a real-world example. Let\u2019s dive in.<\/p>\n<h2>Getting Started with Accounting.js<\/h2>\n<p>Accounting.js is a standalone JavaScript library that does not require jQuery or any other dependencies. Simply download the source code from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/wjcrowcroft\/accounting.js\">the GitHub repository<\/a>, place it in a suitable directory, and link the file in your HTML document.<\/p>\n<pre>\r\n&lt;script src=\"js\/accounting.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<h2>Basic Formatting Techniques<\/h2>\n<p>Accounting.js provides several methods for formatting numbers. The first method we\u2019ll look at is <code>formatMoney()<\/code>, which is used to convert numbers into currency format. You start by calling <code>accounting<\/code> followed by the method\u2019s name, like so:<\/p>\n<pre>\r\naccounting.formatMoney(2000000);\r\n<\/pre>\n<p>In its default configuration, Accounting.js will format the number as follows: it adds a dollar symbol, separates every three digits with a comma, and uses a decimal point to distinguish dollars from cents.<\/p>\n<pre>\r\n$2,000,000.00\r\n<\/pre>\n<p>Accounting.js can also be adjusted to match local formatting standards. For instance, if your local currency is displayed differently, you can customize the output with various <strong>Options<\/strong>.<\/p>\n<p>As an example, here\u2019s how you would format numbers for Germany, which uses periods as thousand separators and commas for decimals:<\/p>\n<pre>\r\n\taccounting.formatMoney(2000000, { \r\n\tsymbol : \"\u20ac\",\r\n\tthousand : \".\",\r\n\tdecimal : \",\",\r\n});\r\n<\/pre>\n<p>The result will look like this:<\/p>\n<pre>\r\n\u20ac2.000.000,00\r\n<\/pre>\n<p>To format a number without including a currency symbol, you can use the <code>formatNumber()<\/code> method.<\/p>\n<h2>Rounding Numbers<\/h2>\n<p>Since currencies often include decimals, rounding them to the nearest whole number can simplify calculations. With <strong>Accounting.js<\/strong>, you can achieve this using the <code>.toFixed()<\/code> method. This function rounds numbers to the nearest decimal or whole number. For example:<\/p>\n<pre>\r\naccounting.toFixed(102.58, 0);\r\n<\/pre>\n<p>This will round the number to:<\/p>\n<pre>\r\n103\r\n<\/pre>\n<h2>Creating a Basic Currency Converter<\/h2>\n<p>In this section, we will use the functions discussed earlier to create a simple currency converter. This will not be an extensive converter but rather a straightforward one to demonstrate the capabilities of Accounting.js.<\/p>\n<p>For this example, we will convert USD into two currencies: KRW (Korean Won) and JPY (Japanese Yen).<\/p>\n<p>Let\u2019s outline our document structure as follows:<\/p>\n<pre>\r\n&lt;div class=\"currency-option\"&gt;\r\n  &lt;div class=\"row\"&gt;\r\n    &lt;h4 class=\"heading\"&gt;From&lt;\/h4&gt;\r\n    &lt;select id=\"input-currency\" disabled&gt;\r\n      &lt;option value=\"USD\" data-symbol=\"$\" selected&gt;US Dollar&lt;\/option&gt;\r\n    &lt;\/select&gt;\r\n    &lt;span id=\"input-symbol\"&gt;$&lt;\/span&gt;\r\n    &lt;input id=\"input-number\" class=\"input\" type=\"number\" min=\"0\"&gt;\r\n  &lt;\/div&gt;\r\n\r\n  &lt;div class=\"row\"&gt;\r\n    &lt;h4 class=\"heading\"&gt;To&lt;\/h4&gt;\r\n    &lt;select id=\"output-currency\"&gt;\r\n      &lt;option value=\"krw\" data-symbol=\"\u20a9\" selected&gt;Korean Won&lt;\/option&gt;\r\n      &lt;option value=\"jpy\" data-symbol=\"\u00a5\"&gt;Japanese Yen&lt;\/option&gt;\r\n    &lt;\/select&gt;\r\n    &lt;span id=\"output-number\"&gt;\u20a9 0&lt;\/span&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>The document structure laid out above includes two rows within a <code>div<\/code>. The first row features a dropdown menu set to USD and disabled, preventing the user from changing it. This row also contains a numeric input field where users will enter the amount of USD to be converted.<\/p>\n<p>The second row also includes a dropdown menu, this time with options for converting to either Korean Won or Japanese Yen. Each option is detailed with a <code>value<\/code> attribute and a <code>data-symbol<\/code> attribute to display the currency symbol. The conversion results are shown in a <code>span<\/code> element next to the dropdown.<\/p>\n<h2>Exchange Rate Details<\/h2>\n<p>As of this writing, 1 USD is equivalent to KRW 1077.80 and JPY 102.24. While these exchange rates can be fetched in real time from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/openexchangerates.org\/\">Open Exchange Rates<\/a>, for the purposes of this example, we\u2019ll store the values in variables using the <code>.toFixed()<\/code> method to round them to whole numbers:<\/p>\n<pre>\r\nvar jpy = accounting.toFixed(102.24, 0),\r\n    krw = accounting.toFixed(1077.80, 0);\r\n<\/pre>\n<h2>Retrieving Currency Options<\/h2>\n<p>Next, we will develop a function to extract the currency value and symbol from the selected option in our dropdown menu. These values are then stored in an <code>Array<\/code>.<\/p>\n<pre>\r\nvar getCurrency = function(elem) {\r\n    var $curAbbr = elem.find(':selected').val(),\r\n        $curSign = elem.find(':selected').data('symbol');\r\n    return {\r\n        'symbol' : $curSign,\r\n        'value' : $curAbbr,\r\n    };\r\n};\r\n<\/pre>\n<h2>The Conversion Function<\/h2>\n<p>We aim for the currency conversion to happen in <strong>real-time<\/strong>, which means it should occur as the user types or switches between currency options.<\/p>\n<p>To implement this, we will attach three JavaScript events to <code>#output-currency<\/code> and <code>#input-number<\/code>: <code><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/api.jquery.com\/change\/\">change<\/a><\/code>, <code><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/api.jquery.com\/keyup\/\">keyup<\/a><\/code>, and <code><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/api.jquery.com\/keydown\/\">keydown<\/a><\/code>. Here\u2019s how we do it:<\/p>\n<pre>\r\n$('#output-currency, #input-number').on('change keyup keydown', function() {\r\n    \/\/ the stuff\r\n});\r\n<\/pre>\n<p>We then use the <code>getCurrency<\/code> function to fetch the value from the dropdown option <code>#output-currency<\/code>. The values are stored in two variables: <code>$symbol<\/code> and <code>$val<\/code>.<\/p>\n<pre>\r\nvar $currency = getCurrency($('#output-currency')),\r\n    $symbol = $currency['symbol'],\r\n    $val = $currency['value'];\r\n<\/pre>\n<p>We also need to capture the number from the input field, and decide which currency rate to use based on the value of <code>$val<\/code>, whether it\u2019s <code>jpy<\/code> or <code>krw<\/code>.<\/p>\n<pre>\r\nvar multiplyNum = ($val == 'jpy') ? jpy : krw;\r\nvar $getInput = $('#input-number').val();\r\n<\/pre>\n<p>With the input value and currency rate, we calculate the result.<\/p>\n<pre>\r\nvar $getTotal = $getInput * multiplyNum;\r\n<\/pre>\n<p>Before displaying the result, we format the number using the <code>.formatMoney()<\/code> method:<\/p>\n<pre>\r\nvar number = accounting.formatMoney($getTotal, {\r\n    symbol : $symbol,\r\n    precision : 0,\r\n    thousand : ','\r\n});\r\n<\/pre>\n<p>Finally, we display the formatted total in the specified output element.<\/p>\n<pre>\r\n$('#output-number').text(number);\r\n<\/pre>\n<p>Below is a demo of the converter in action:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif\" alt=\"Demo of simple currency converter using Accounting.js\" height=\"320\" width=\"500\"><\/figure>\n<p>You can also try it yourself from our demo page.<\/p>\n<p><a href=\"https:\/\/hongkiat.github.io\/accounting-js\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  View demo <\/span><\/a>\n<a href=\"https:\/\/github.com\/hongkiat\/accounting-js\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Download source\n<\/span><\/a><\/p>\n<h2>Final Thoughts<\/h2>\n<p>Formatting numbers into currency formats is simpler than it might seem. With Accounting.js, this task becomes straightforward. We have also demonstrated how to use these functions to create a working simple currency converter. Give it a try.<\/p>","protected":false},"excerpt":{"rendered":"<p>Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[4117],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use Accounting.js for Effective Number Formatting - Hongkiat<\/title>\n<meta name=\"description\" content=\"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Accounting.js for Effective Number Formatting\" \/>\n<meta property=\"og:description\" content=\"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2014-04-11T10:01:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:44:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Use Accounting.js for Effective Number Formatting\",\"datePublished\":\"2014-04-11T10:01:53+00:00\",\"dateModified\":\"2025-04-03T17:44:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/\"},\"wordCount\":812,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-accounting-js\\\/converter-demo.gif\",\"keywords\":[\"Javascripts\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/\",\"name\":\"How to Use Accounting.js for Effective Number Formatting - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-accounting-js\\\/converter-demo.gif\",\"datePublished\":\"2014-04-11T10:01:53+00:00\",\"dateModified\":\"2025-04-03T17:44:08+00:00\",\"description\":\"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-accounting-js\\\/converter-demo.gif\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jquery-accounting-js\\\/converter-demo.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jquery-accounting-js\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Accounting.js for Effective Number Formatting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Accounting.js for Effective Number Formatting - Hongkiat","description":"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Accounting.js for Effective Number Formatting","og_description":"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.","og_url":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-04-11T10:01:53+00:00","article_modified_time":"2025-04-03T17:44:08+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Use Accounting.js for Effective Number Formatting","datePublished":"2014-04-11T10:01:53+00:00","dateModified":"2025-04-03T17:44:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/"},"wordCount":812,"commentCount":2,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif","keywords":["Javascripts"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/","url":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/","name":"How to Use Accounting.js for Effective Number Formatting - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif","datePublished":"2014-04-11T10:01:53+00:00","dateModified":"2025-04-03T17:44:08+00:00","description":"Learn how to use jQuery Accounting.js to format numbers, currencies, and dates in your web applications for a professional and polished look.","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/jquery-accounting-js\/converter-demo.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/jquery-accounting-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Accounting.js for Effective Number Formatting"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-59f","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=19793"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19793\/revisions"}],"predecessor-version":[{"id":73677,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19793\/revisions\/73677"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=19793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=19793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=19793"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=19793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}