Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Number To Words

Number To Words Laravel Package

phpviet/number-to-words

phpviet/number-to-words converts numeric values into readable Vietnamese words. It handles integers, decimals, and currency amounts, making it easy to generate invoices, receipts, and payment notices with properly formatted Vietnamese text. Simple API, framework-agnostic, installs via Composer.

Deep Wiki
Context7

:zap: Thư viện hổ trợ chuyển đổi số sang chữ số Tiếng Việt.

Frequently asked questions about Number To Words
How do I install phpviet/number-to-words in a Laravel application?
Install it with Composer using the package name phpviet/number-to-words. Laravel auto-discovery and service provider support should not be assumed, so verify the package metadata or register the provider and facade manually if needed. Keep the package behind an application-owned interface or service rather than calling its classes directly from controllers or Blade templates.
Does phpviet/number-to-words support Laravel 10, 11, and 12?
That must be proven on your actual runtime matrix, because the last release was in October 2021 and newer Laravel support is not confirmed in the overview. Test installation against your target PHP 8.2 to 8.4 and Laravel versions, then pin the exact package version in composer.lock. If Composer constraints block a framework upgrade, fork the package under an internal namespace or replace it behind your adapter.
Can I use phpviet/number-to-words without Laravel as a standalone PHP library?
Yes. The package is described as a lightweight, dependency-free PHP library with a simple API, so it can be loaded through Composer autoload in any PHP project. You still should wrap it in your own converter interface so call sites remain independent of the vendor namespace. Verify UTF-8 and mbstring behavior in your runtime before relying on Vietnamese output.
Does phpviet/number-to-words handle decimals, negative numbers, and large values?
The package overview states that it supports decimals, negatives, and large values, but you should validate the exact limits for your use case. Define the maximum amount size and decimal precision your application requires, then test values near PHP integer and float boundaries. Financial and legal documents should only use outputs that have been checked against finance-approved examples.
How do I add a currency unit such as đồng or VNĐ to the Vietnamese words output?
The package advertises optional currency or unit suffixes for invoice totals. Review the actual API to confirm how suffixes are supplied for your pinned version. Because wording rules for financial and legal text vary, have finance or legal sign off on the exact rendered phrase, including the unit and any accompanying number formatting.
Is the Vietnamese wording accurate for edge cases like một/mốt, năm/lăm, and linh/lẻ?
Linguistic correctness is the main product risk, especially for large numbers, decimals, leading zeros, negatives, and Vietnamese conventions such as một/mốt, năm/lăm, and linh/lẻ. Build a golden-output test set with representative amounts and have finance or legal approve it. Run those tests against the pinned package version before using it on invoices, receipts, contracts, or payment notices.
Should I call phpviet/number-to-words directly from Blade templates or controllers?
No. Put the package behind an application-owned NumberToWordsConverter interface or equivalent service, then inject that abstraction into controllers, jobs, and templates. This keeps your code independent of the vendor namespace and makes a fork or alternative implementation possible without changing call sites. Bind the implementation manually in the Laravel container if auto-discovery is not available.
Is phpviet/number-to-words maintained and safe to use in production?
The available signals are weak: a last release in October 2021, 21 stars, and unknown repository provenance. Day-to-day code maintenance is likely low, but dependency-risk maintenance is elevated, so assign an owner, monitor advisories, and pin the version. Budget for an internal fork or replacement if the package becomes incompatible with current PHP or Laravel releases.
How should I test number-to-words output for invoices and contracts?
Start with a golden-output test set covering integers, zero, decimals, negatives, leading zeros, large amounts, and currency suffixes. Encode the finance- and legal-approved Vietnamese phrases as expected values in unit tests around your adapter. Run those tests in CI against the pinned package version and repeat them whenever PHP, Laravel, or the package version changes.
What are the alternatives if phpviet/number-to-words becomes incompatible or is abandoned?
Because the package sits behind your own converter interface, you can fork it under an internal namespace or replace it with a maintained alternative without changing product call sites. Document the fork-or-replace criteria and roll changes out behind a feature flag on a low-risk surface such as invoice preview. Validate the replacement against the same finance-approved golden outputs before production rollout.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console