Download the PHP package abdulbaset/convert-numbers without Composer
On this page you can find all versions of the php package abdulbaset/convert-numbers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abdulbaset/convert-numbers
More information about abdulbaset/convert-numbers
Files in abdulbaset/convert-numbers
Package convert-numbers
Short Description A PHP package to convert numbers to words and currencies in multiple languages
License MIT
Homepage https://digitalatum.com
Informations about the package convert-numbers
Convert Numbers
A comprehensive PHP package for number conversion, supporting multiple languages and various conversion types.
Installation
Install the package via Composer:
Usage
Basic Number Conversion
Currency Conversion
File Size Formatting
Architecture
The package follows SOLID principles and clean architecture:
-
Single Responsibility Principle (SRP)
- Each class has a single responsibility
- Language classes handle language-specific conversions
- Currency classes manage currency-specific logic
- Utility classes for formatting and conversion
-
Open/Closed Principle (OCP)
- Easy to add new languages by extending
LanguageAbstract
- New currencies can be added by extending
CurrencyAbstract
- No modification needed to existing code
- Easy to add new languages by extending
-
Interface Segregation Principle (ISP)
- Separate interfaces for different functionalities
ConverterInterface
for number conversionCurrencyInterface
for currency operationsFileSizeInterface
for file size formatting
- Dependency Inversion Principle (DIP)
- High-level modules depend on abstractions
- Easy to swap implementations
Features
1. Number to Words Conversion
- Convert integers and decimal numbers to words
- Support for negative numbers
- Decimal point handling
- Language-specific formatting
2. Currency Handling
- Convert currency amounts to words
- Format currency with proper separators
- Optional currency symbol display
- Support for multiple currencies:
- USD (US Dollar)
- EUR (Euro)
- EGP (Egyptian Pound)
- SAR (Saudi Riyal)
3. File Size Formatting
- Convert bytes to human-readable formats
- Automatic unit selection (B, KB, MB, GB, TB, PB)
- Language-specific unit names
- Customizable decimal places
4. Multi-language Support
- Arabic (ar)
- English (en)
- French (fr)
5. Number Formatting
- Language-specific decimal separators
- Thousands separators
- Arabic numeral conversion
Use Cases
Here are some practical scenarios where this package can be useful:
📄 Invoices & Legal Documents
- Convert numbers to words in invoices and contracts for better clarity.
- Display financial amounts in words to ensure legal accuracy.
💰 Financial & Accounting Applications
- Format and display monetary values properly.
- Convert currency values into readable words for multi-language support.
🛍 CMS & E-commerce Platforms
- Improve user experience by displaying formatted numbers in different languages.
- Show file sizes in a human-readable format for media uploads.
🌍 Multi-language Applications
- Convert numeric values to words in different languages without extra dependencies.
- Provide better localization for global users.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Change Log
For a detailed list of changes and updates in each version, see the Change Log.
License
This package is open-sourced software licensed under the LICENSE license.
Support
For support:
- Email: [email protected]
- Create an issue in the GitHub repository
Donations 💖
Maintaining this package takes time and effort. If you’d like to support its development and keep it growing, you can:
- 🌟 Star this repository
- 📢 Sharing it with others
- 🛠️ Contribute by reporting issues or suggesting features
- ☕ Buy me a coffee
- ❤️ Become a sponsor on GitHub Sponsors
- 💵 Make a one-time donation via PayPal
Your support means a lot to me! Thank you for making this possible. 🙏