コード例 #1
0
 /**
  * {@inheritDoc}
  */
 protected function configure()
 {
     $this->addOption('precision', 0);
     // Integer cast rounds towards 0, so do the same when displaying fractions
     $this->addOption('rounding-mode', NumberToLocalizedStringTransformer::ROUND_DOWN);
     parent::configure();
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 protected function configure()
 {
     $this->addOption('precision', 0);
     $this->addOption('percent_type', self::FRACTIONAL);
     parent::configure();
     $this->setValueTransformer(new PercentToLocalizedStringTransformer(array('precision' => $this->getOption('precision'), 'type' => $this->getOption('percent_type'))));
 }
コード例 #3
0
ファイル: MoneyField.php プロジェクト: skoop/symfony-sandbox
 /**
  * {@inheritDoc}
  */
 protected function configure()
 {
     $this->addOption('precision', 2);
     $this->addOption('divisor', 1);
     $this->addOption('currency');
     parent::configure();
     $this->setValueTransformer(new MoneyToLocalizedStringTransformer(array('precision' => $this->getOption('precision'), 'grouping' => $this->getOption('grouping'), 'divisor' => $this->getOption('divisor'))));
 }