Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to force writing zero fraction #60

Open
naja7host opened this issue Jan 22, 2019 · 3 comments
Open

how to force writing zero fraction #60

naja7host opened this issue Jan 22, 2019 · 3 comments

Comments

@naja7host
Copy link

how to force write zero fraction, so if i have 144.00 USD i get the fallowing

$currencyTransformer->toWords(14400, 'USD');
one hundred forty-four dollar.

i want to get
one hundred forty-four dollar and zero cent .

@kwn
Copy link
Owner

kwn commented Jan 29, 2019

You can't at the moment. Feel free to add the missing functionality. Thanks!

andrey-helldar pushed a commit to andrey-helldar/number-to-words that referenced this issue Jul 5, 2019
@andrey-helldar
Copy link
Contributor

andrey-helldar commented Jul 5, 2019

I can be wrong, but it seems to me that this functionality already exists (see #79 PR).
I studied the code and added documentation.

PS:
Immediately I apologize if something in the description is written incorrectly.
I know English very poorly, so I translate Google Translate.
¯_(ツ)_/¯

@naja7host
Copy link
Author

is not working, or maybe i have missed something

$CurrencyTransformerOptions = new CurrencyTransformerOptions(); $CurrencyTransformerOptions->setConvertFractionIfZero(true); $CurrencyTransformerOptions->setShowDecimalIfZero(true); $numberToWords = new NumberToWords(); $currencyTransformer = $numberToWords->getCurrencyTransformer('en'); $text = $currencyTransformer->toWords(26400, 'USD', $CurrencyTransformerOptions);

output

two hundred sixty-four dollars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants