4
4
use js \tools \numbers2words \exceptions \InvalidArgumentException ;
5
5
6
6
/**
7
- * This class offers a number spelling in various languages.
8
- * It is a work-in-progress and more languages are to be added in future.
9
- * The main and only two public methods are spellNumber() and spellCurrency().
7
+ * This class offers number spelling in various languages.
10
8
*
11
9
* @author Juris Sudmalis
12
10
*/
@@ -56,7 +54,7 @@ private final function __construct()
56
54
}
57
55
58
56
/**
59
- * @param string $language : a two-letter, ISO 639-1 code of the language
57
+ * @param string $language A two-letter, ISO 639-1 code of the language.
60
58
* @return Speller
61
59
*/
62
60
private static function get ($ language )
@@ -96,11 +94,10 @@ public static function getAcceptedCurrencies()
96
94
/**
97
95
* Convert a number into its linguistic representation.
98
96
*
99
- * @param int $number : the number to spell in the specified language
100
- * @param string $language : a two-letter, ISO 639-1 code of the language to spell the number in
101
- * @return string : the whole part as written in words in the specified language plus ISO 639-1 code
102
- * and decimal part in ##/100 format
103
- * @throws InvalidArgumentException if any parameter is invalid
97
+ * @param int $number The number to spell in the specified language.
98
+ * @param string $language A two-letter, ISO 639-1 code of the language to spell the number in.
99
+ * @return string The number as written in words in the specified language.
100
+ * @throws InvalidArgumentException If any parameter is invalid.
104
101
*/
105
102
public static function spellNumber ($ number , $ language )
106
103
{
@@ -114,11 +111,11 @@ public static function spellNumber($number, $language)
114
111
* Convert currency to its linguistic representation.
115
112
* The format is {whole part spelled} CODE {decimal part}/100.
116
113
*
117
- * @param int|float $amount : the amount to spell in the specified language
118
- * @param string $language : a two-letter, ISO 639-1 code of the language to spell the amount in
119
- * @param string $currency : a three-letter, ISO 4217 currency code
120
- * @return string : the currency as written in words in the specified language with ISO 4217 currency code
121
- * @throws InvalidArgumentException if any parameter is invalid
114
+ * @param int|float $amount The amount to spell in the specified language.
115
+ * @param string $language A two-letter, ISO 639-1 code of the language to spell the amount in.
116
+ * @param string $currency A three-letter, ISO 4217 currency code.
117
+ * @return string The currency as written in words in the specified language.
118
+ * @throws InvalidArgumentException If any parameter is invalid.
122
119
*/
123
120
public static function spellCurrencyShort ($ amount , $ language , $ currency )
124
121
{
@@ -142,14 +139,14 @@ public static function spellCurrencyShort($amount, $language, $currency)
142
139
/**
143
140
* Convert currency to its linguistic representation.
144
141
*
145
- * @param int|float $amount : the amount to spell in the specified language
146
- * @param string $language : a two-letter, ISO 639-1 code of the language to spell the amount in
147
- * @param string $currency : a three-letter, ISO 4217 currency code
148
- * @param bool $requireDecimal : if true, output decimals even if the value is 0
149
- * @param bool $spellDecimal : if true, spell decimals out same as whole numbers;
150
- * otherwise, output decimals as numbers
151
- * @return string : the currency as written in words in the specified language
152
- * @throws InvalidArgumentException if any parameter is invalid
142
+ * @param int|float $amount The amount to spell in the specified language.
143
+ * @param string $language A two-letter, ISO 639-1 code of the language to spell the amount in.
144
+ * @param string $currency A three-letter, ISO 4217 currency code.
145
+ * @param bool $requireDecimal If true, output decimals even if the value is 0.
146
+ * @param bool $spellDecimal If true, spell decimals out same as whole numbers;
147
+ * otherwise, output decimals as numbers.
148
+ * @return string The currency as written in words in the specified language.
149
+ * @throws InvalidArgumentException If any parameter is invalid.
153
150
*/
154
151
public static function spellCurrency ($ amount , $ language , $ currency , $ requireDecimal = true , $ spellDecimal = false )
155
152
{
0 commit comments