Hi there,

I made the following class to render my decimal numbers with commas
instead of dots. But if the form does not validate, then the render
function is called with the user entered value. So the first time, for
instance, its called with 14.54(dot) to show the form. It is shown as
14,54(comma). When the user submits the form (that is not validated) ,
then its called with 14,54 (comma) and does not work as expected.

Am I doing something wrong here?
Is the Class right implemented?

thks,
Bruno

-----

class sfWidgetFormInputDecimal extends sfWidgetForm
{

  protected function configure($options = array(), $attributes = array())
  {
    parent::configure($options,$attributes);
    $this->addRequiredOption('culture');
  }


  public function render($name, $value = null, $attributes = array(),
$errors = array())
  {
    $numberFormat = new sfNumberFormat($this->getOption('culture'));
    $value = $numberFormat->format($value);
    return $this->renderTag('input', array_merge(array('type' =>
$this->getOption('type'), 'name' => $name, 'value' => $value),
$attributes));
  }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to