CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, Fhalcon, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Wed Jun 26, 2019 11:50 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Numbers to letters
PostPosted: Tue Sep 25, 2018 1:57 am 
Offline

Joined: Tue Sep 25, 2018 1:47 am
Posts: 1
Hi,
I need a function php to converter number to letter(String).
For example:

I have 250 and I want to response Duecentocinquanta in my string ($decod).

Thanks Thanks Thanks

_________________
dich vu giup viec nha uy tín giúp việc nhà chuyên nghiệp


Top
 Profile  
 
 Post subject: Re: Numbers to letters
PostPosted: Wed Sep 26, 2018 12:26 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3399
Hi.

You should use NumberFormatter class
http://php.net/manual/en/class.numberformatter.php

Code:
$numberFormatter = new \NumberFormatter("it-IT", \NumberFormatter::SPELLOUT);
echo $numberFormatter->format(250);  // due¬cento¬cinquanta


Regards,
Codelobster Team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2016 phpBB Group