{"id":664,"date":"2012-11-10T06:15:55","date_gmt":"2012-11-10T06:15:55","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=374"},"modified":"2012-11-10T06:15:55","modified_gmt":"2012-11-10T06:15:55","slug":"indian-money-format-javascript","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/indian-money-format-javascript\/","title":{"rendered":"Indian Money Format javascript"},"content":{"rendered":"<pre>\n\/\/function for converting string into indian currency format\n    function intToFormat(nStr)\n    {\n     nStr += '';\n     x = nStr.split('.');\n     x1 = x[0];\n     x2 = x.length &gt; 1 ? '.' + x[1] : '';\n     var rgx = \/(d+)(d{3})\/;\n     var z = 0;\n     var len = String(x1).length;\n     var num = parseInt((len\/2)-1);\n \n      while (rgx.test(x1))\n      {\n        if(z &gt; 0)\n        {\n          x1 = x1.replace(rgx, '$1' + ',' + '$2');\n        }\n        else\n        {\n          x1 = x1.replace(rgx, '$1' + ',' + '$2');\n          rgx = \/(d+)(d{2})\/;\n        }\n        z++;\n        num--;\n        if(num == 0)\n        {\n          break;\n        }\n      }\n     return x1 + x2;\n    }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/function for converting string into indian currency format function intToFormat(nStr) { nStr += &#8221;; x = nStr.split(&#8216;.&#8217;); x1 = x[0]; x2 = x.length &gt; 1 ? &#8216;.&#8217; + x[1] : &#8221;; var rgx = \/(d+)(d{3})\/; var z = 0; var len = String(x1).length; var num = parseInt((len\/2)-1); while (rgx.test(x1)) { if(z &gt; 0) { x1&hellip; <a href=\"https:\/\/codethataint.com\/blog\/indian-money-format-javascript\/\">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],"tags":[],"class_list":["post-664","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=664"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/664\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}