Skip to content

Commit 0df965e

Browse files
update
1 parent edc5d57 commit 0df965e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

NumberToWords.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class NumberToWords
3131
*/
3232
private static mixed $staticData = null;
3333

34+
3435
public function __construct()
3536
{
3637
if (!self::isWordsInstance()) {
@@ -116,6 +117,14 @@ public function toNumber(): string
116117
return $decimal !== '0' ? ($integer . '.' . $decimal) : $integer;
117118
}
118119

120+
/**
121+
* Translate numbers into readable text formats
122+
*/
123+
public function toText(): ?string
124+
{
125+
return $this->formatToText();
126+
}
127+
119128
/**
120129
* Convert Words To Number (arbitrary-precision using strings)
121130
*/
@@ -313,14 +322,6 @@ private static function removeCurrencyNames($value)
313322
return $value;
314323
}
315324

316-
/**
317-
* Translate numbers into readable text formats
318-
*/
319-
public function toText(): ?string
320-
{
321-
return $this->formatToText();
322-
}
323-
324325
/**
325326
* Format the numbers to text
326327
*/

Tests/numberToWords.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
dd(
88

9-
NumberToWords::cents(true)->iso('FRA')->value('4531232221205435349345443534.21')->toText(),
9+
// NumberToWords::cents(true)->iso('FRA')->value('4531232221205435349345443534.21')->toText(),
1010

1111
// NumberToWords::iso('FRA')->cents(true)->value('1000000000000000057857959942726969827393378689175040438172647424')->toText(),
1212

@@ -17,7 +17,6 @@
1717
// comma is used to seperate decimals
1818
NumberToWords::value('Thirty-four million five hundred and ninety thousand three hundred and
1919
twenty-three euro, two hundred and thirty-one cents')
20-
->cents(false)
2120
->toNumber(),
2221

2322
// comma is used to seperate decimals
@@ -27,7 +26,7 @@
2726
three hundred and forty-nine billion three hundred and forty-five
2827
million four hundred and forty-three thousand five hundred and
2928
thirty-four Euro, twenty-one cents')
30-
->cents(false)
29+
->cents(true)
3130
->toNumber(),
3231

3332

0 commit comments

Comments
 (0)