kwn/number-to-words

View on GitHub
src/CurrencyTransformer/SwahiliCurrencyTransformer.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace NumberToWords\CurrencyTransformer;

use NumberToWords\Legacy\Numbers\Words;
use NumberToWords\TransformerOptions\CurrencyTransformerOptions;

class SwahiliCurrencyTransformer implements CurrencyTransformer
{
    public function toWords(int $amount, string $currency, ?CurrencyTransformerOptions $options = null): string
    {
        $converter = new Words($options);

        return $converter->transformToCurrency($amount, 'sw', $currency);
    }
}