CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript, Python code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Tue Mar 19, 2024 9:36 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: 3931
Hi.

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

Code:
= new \NumberFormatter("it-IT", \NumberFormatter::SPELLOUT);
echo ->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 17 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