hekmatinasser/notowo
Laravel package for converting numbers to Persian (Farsi) and Arabic words. Includes helpers for spelling out amounts (e.g., in invoices), formatting digits, and handling different locales/scripts for readable, localized output.
123 → "one hundred twenty-three"). It fits well in applications requiring human-readable number representations (e.g., invoices, financial reports, or localized systems).0, 999,999,999, negative numbers)?NumberFormatter) be more maintainable?spatie/array-to-xml, moneyphp/money)?AppServiceProvider.Str::toWords($number)).@toWords directive for templates.response()->json(['amount_word' => toWords($amount)])).barryvdh/laravel-dompdf or maatwebsite/excel.App::setLocale() for dynamic language support.composer require hekmatinasser/notowo.use Hekmatinasser\Notowo\Notowo;
$notowo = new Notowo();
echo $notowo->convertNumberToWords(123); // "one hundred twenty-three"
app/Services/NumberToWordService.php):
class NumberToWordService {
public function convert($number, string $locale = 'en') {
$notowo = new Notowo();
return $notowo->convertNumberToWords($number);
}
}
AppServiceProvider:
$this->app->bind(NumberToWordService::class, function ($app) {
return new NumberToWordService();
});
class CustomNotowo extends Notowo {
public function convertCurrency($amount, $currency = 'dollar') {
$words = $this->convertNumberToWords($amount);
return "{$words} {$currency}" . ($amount != 1 ? 's' : '');
}
}
laravel/framework, guzzlehttp/guzzle).null, non-numeric inputs).10,000 conversions/sec).Cache::remember()).dd() or Laravel Debugbar to inspect inputs/outputs.try {
$result = $notowo->convertNumberToWords($input);
} catch (\Exception $e) {
Log::error("Number conversion failed for {$input}", ['error' => $e]);
$result = 'N/A';
}
hekmatinasser/notowo).Cache::forever()).Illuminate\Bus\Queueable).1000 requests/sec) to validate memory/CPU usage.for ($i = 0; $i < 10000; $i++) {
$notowo->convertNumberToWords(rand(1, 999999));
How can I help you explore Laravel packages today?