I think you have three solutions:

1) Override getPrice method with something like

public function getPrice()
{
  $price = parent::getPrice();
  return number($price, 2);
}

2) Create your simple PriceFormWidget that will format your number
the way you want

3) Possibly cleaner: create your PriceValidator (not completely sure
at the moment but if I remember well by convention possible
transfromation of the form values are left to validators in symfony
please someone correct me if I'mwrong because I don't remember a
concrete example for this)

Martino

On Wed, Feb 11, 2009 at 4:29 PM, Tom Haskins-Vaughan
<[email protected]> wrote:
>
>> Tom Haskins-Vaughan
>> That is a nice solution, but how to trigger it for every number field?
>> Make it as some kind of filter?
>
> I don't know, I'm afraid. Anyone else?
>
> --
> Tom Haskins-Vaughan
> Temple Street Media: Design and Development for the Web
> [email protected] | www.templestreetmedia.com
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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