Example #1
0
 /**
  * Formats spellout number according to locale settings.
  *
  * Options format:
  * array(
  *     'attributes' => array(
  *          <attribute> => <value>,
  *          ...
  *      ),
  *     'textAttributes' => array(
  *          <attribute> => <value>,
  *          ...
  *      ),
  *     'symbols' => array(
  *          <symbol> => <value>,
  *          ...
  *      ),
  *     'locale' => <locale>
  * )
  *
  * @param float $value
  * @param array $options
  * @return string
  */
 public function formatSpellout($value, array $options = array())
 {
     $attributes = (array) $this->getOption($options, 'attributes', array());
     $textAttributes = (array) $this->getOption($options, 'textAttributes', array());
     $symbols = (array) $this->getOption($options, 'symbols', array());
     $locale = $this->getOption($options, 'locale');
     return $this->formatter->formatSpellout($value, $attributes, $textAttributes, $symbols, $locale);
 }
 /**
  * @dataProvider formatSpelloutDataProvider
  */
 public function testFormatSpellout($expected, $value, $attributes, $textAttributes, $symbols, $locale)
 {
     $this->assertEquals($expected, $this->formatter->formatSpellout($value, $attributes, $textAttributes, $symbols, $locale));
 }