{"id":383,"date":"2024-10-03T10:46:33","date_gmt":"2024-10-03T04:46:33","guid":{"rendered":"https:\/\/itllive.com\/knowledgebase\/?p=383"},"modified":"2024-10-03T10:46:33","modified_gmt":"2024-10-03T04:46:33","slug":"how-to-use-php-numberformatter-to-convert-numbers-to-words","status":"publish","type":"post","link":"https:\/\/itllive.com\/knowledgebase\/2024\/10\/03\/how-to-use-php-numberformatter-to-convert-numbers-to-words\/","title":{"rendered":"How to use PHP NumberFormatter to convert numbers to words"},"content":{"rendered":"<p>Enable intl extension in PHP.ini (Remove the semicolon before)<br \/>\nextension=intl<\/p>\n<p>Run composer update<\/p>\n<p>to use the PHP NumberFormatter import class NumberFormatter<br \/>\nuse NumberFormatter;<\/p>\n<p>create an instance of the class like below:<br \/>\n$numberFormatter = new NumberFormatter(&#8216;en&#8217;,NumberFormatter::SPELLOUT);<br \/>\nthen use this instance to convert the desired numbers to words<br \/>\n$numberFormatter-&gt;format(yourValue);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enable intl extension in PHP.ini (Remove the semicolon before) extension=intl Run composer update to use the PHP NumberFormatter ...<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":1,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":384,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/383\/revisions\/384"}],"wp:attachment":[{"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itllive.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}