<?php
$result = (new \MessageFormatter('ru-RU', '{n, spellout}'))->format(['n' => 321]);
echo $result; // триста двадцать один
$result = (new \MessageFormatter('ru-RU', '{n, spellout,%spellout-cardinal-feminine}'))->format(['n' => 321]);
echo $result; // триста двадцать одна