-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ashokdevatwal/feature/hindi
Added Hindi to the List of supported languages
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Convert Numbers to Words in Laravel | ||
|
||
Easily convert numbers to words in Laravel using this library, which leverages the native `PHP INTL` extension to perform conversion effortlessly. With this library, you can convert numbers to words in various languages and also obtain the value in currency format according to the selected language. Supported languages include English, Spanish, Portuguese, French, Italian, Romanian, and with the contribution of [Siros Fakhri](https://github.com/sirosfakhri), Persian (Farsi) support has been added. | ||
Easily convert numbers to words in Laravel using this library, which leverages the native `PHP INTL` extension to perform conversion effortlessly. With this library, you can convert numbers to words in various languages and also obtain the value in currency format according to the selected language. Supported languages include English, Spanish, Portuguese, French, Italian, Romanian, Hindi and with the contribution of [Siros Fakhri](https://github.com/sirosfakhri), Persian (Farsi) support has been added. | ||
|
||
⚙️ This library is compatible with Laravel versions 8.0 and higher ⚙️ | ||
|
||
|
@@ -46,6 +46,7 @@ SpellNumber::getAllLocales(); | |
// 4 => "it" (Italian) | ||
// 5 => "ro" (Romanian) | ||
// 6 => "fa" (Farsi) | ||
// 7 => "hi" (India) | ||
// ] | ||
``` | ||
|
||
|
@@ -62,6 +63,9 @@ SpellNumber::value(100)->locale('fa')->toLetters(); | |
|
||
SpellNumber::value(100)->locale('en')->toLetters(); | ||
// "One Hundred" | ||
|
||
SpellNumber::value(100)->locale('hi')->toLetters(); | ||
// "एक सौ" | ||
``` | ||
|
||
#### Convert Floating-Point Numbers | ||
|
@@ -71,6 +75,9 @@ If needed, you can pass a floating-point number as an argument to convert it to | |
```php | ||
SpellNumber::value(123456789.12)->locale('es')->toLetters(); | ||
// "Ciento Veintitrés Millones Cuatrocientos Cincuenta Y Seis Mil Setecientos Ochenta Y Nueve Con Doce" | ||
|
||
SpellNumber::value(123456789.12)->locale('hi')->toLetters(); | ||
// "बारह करोड़ चौंतीस लाख छप्पन हज़ार सात सौ नवासी और बारह" | ||
``` | ||
|
||
#### Convert to Currency Format | ||
|
@@ -86,6 +93,12 @@ SpellNumber::value(100.12)->locale('es')->currency('Pesos')->fraction('centavos' | |
|
||
SpellNumber::value(100)->locale('fa')->currency('تومان')->toMoney(); | ||
// "صد تومان" | ||
|
||
SpellNumber::value(100.12)->locale('hi')->currency('रूपये')->fraction('पैसे')->toMoney(); | ||
// "एक सौ रूपये और बारह पैसे" | ||
|
||
SpellNumber::value(100)->locale('hi')->currency('रूपये')->toMoney(); | ||
// "एक सौ रूपये" | ||
``` | ||
|
||
#### Other Initializer Methods | ||
|
@@ -106,7 +119,8 @@ SpellNumber::float('12345.23')->locale('es')->toLetters(); | |
- Email: [email protected] | ||
|
||
## Contributors | ||
[Siros Fakhri](https://github.com/sirosfakhri) (Farsi Language) | ||
- [Siros Fakhri](https://github.com/sirosfakhri) (Farsi Language) | ||
- [Ashok Devatwal](https://github.com/ashokdevatwal) (Hindi Language) | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters