CommerceGuys\Intl\Formatter\NumberFormatter::getMaximumFractionDigits PHP Method

getMaximumFractionDigits() public method

    public function getMaximumFractionDigits()
    {
        return $this->maximumFractionDigits;
    }

Usage Example

 /**
  * @covers ::getMaximumFractionDigits
  *
  * @uses \CommerceGuys\Intl\Formatter\NumberFormatter::__construct
  * @uses \CommerceGuys\Intl\NumberFormat\NumberFormat
  */
 public function testMaximumFractionDigits()
 {
     $numberFormat = $this->createNumberFormat($this->numberFormats['latn']);
     // Defaults to 3 for decimal and percentage formats.
     $formatter = new NumberFormatter($numberFormat, NumberFormatter::DECIMAL);
     $this->assertEquals(3, $formatter->getMaximumFractionDigits());
     $formatter = new NumberFormatter($numberFormat, NumberFormatter::PERCENT);
     $this->assertEquals(3, $formatter->getMaximumFractionDigits());
     // Should default to null for currency formats.
     $formatter = new NumberFormatter($numberFormat, NumberFormatter::CURRENCY);
     $this->assertNull($formatter->getMaximumFractionDigits());
     $formatter = new NumberFormatter($numberFormat, NumberFormatter::CURRENCY_ACCOUNTING);
     $this->assertNull($formatter->getMaximumFractionDigits());
 }