You are here

PercentageFormatter.php in Currency 7.2

Contains class \BartFeenstra\CLDR\Percentageformatter.

Namespace

BartFeenstra\CLDR

File

currency/vendor/bartfeenstra/cldr/src/BartFeenstra/CLDR/PercentageFormatter.php
View source
<?php

/**
 * @file
 * Contains class \BartFeenstra\CLDR\Percentageformatter.
 */
namespace BartFeenstra\CLDR;


/**
 * Formats a percentage or permille according CLDR number pattern guidelines.
 */
class PercentageFormatter extends DecimalFormatter {

  /**
   * The percent symbol.
   *
   * @var string
   */
  const SYMBOL_SPECIAL_PERCENT = '%';

  /**
   * The permille symbol.
   *
   * Because there is no consistent way of writing "per mille" in English, we
   * use the Latin variant to prevent possible confusion with "million".
   *
   * @var string
   */
  const SYMBOL_SPECIAL_PERMILLE = '‰';

  /**
   * Overrides parent::replacePlaceholders()
   */
  function replacePlaceholders(array $symbols, array $replacements = array()) {
    parent::replacePlaceholders($symbols, array(
      self::SYMBOL_SPECIAL_PERCENT,
      self::SYMBOL_SPECIAL_PERMILLE,
    ));
  }

}

Classes

Namesort descending Description
PercentageFormatter Formats a percentage or permille according CLDR number pattern guidelines.