Number to Words Conversion
ThenumberToWords utility converts numeric values into their Persian word equivalents with comprehensive support for ordinals, currency formatting, and various number scales.
Basic Usage
Simple Conversion
Advanced Options
The function accepts an optional configuration object for customized behavior:Ordinal Numbers
Generate ordinal numbers (first, second, third, etc.) in Persian:Currency Formatting
Format numbers as currency amounts:Number Scales
Choose between short and long scale representations:Supported Number Ranges
Range Support
- Minimum: 0 - Maximum: 999,999,999,999,999 (15 digits) - Decimals: Not supported (integers only) - Negative: Not supported (returns empty string)
Examples by Scale
Thousands
Millions
Billions and Beyond
Edge Cases
Zero and Invalid Input
Very Large Numbers
TypeScript Support
The utility provides full TypeScript support with proper type definitions:Performance Considerations
🚀 Optimization Tips
🚀 Optimization Tips
- Cache results for frequently used numbers
- Use tree-shaking to include only this utility
- Consider batch processing for large datasets
📊 Benchmarks
📊 Benchmarks
- Small numbers (1-999): ~0.1ms
- Medium numbers (1K-999K): ~0.2ms
- Large numbers (1M+): ~0.5ms
