<?php

require __DIR__ . '/number-to-words_1.13/autoload.php';

use NumberToWords\NumberToWords;

$amount = $values['amount'];
$language = $values['language'];

// create the number to words "manager" class
$numberToWords = new NumberToWords();

// -----------------------  build a new number transformer using the RFC 3066 language identifier
// $numberTransformer = $numberToWords->getNumberTransformer($language);

// $values['text'] = $numberTransformer->toWords($amount); 

// ---------------------- build a new currency transformer using the RFC 3066 language identifier
$currencyTransformer = $numberToWords->getCurrencyTransformer($language);

$values['text'] = $currencyTransformer->toWords(($amount*100),'USD'); 

