You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gabriel Belingueres <be...@gmail.com> on 2007/08/01 23:56:57 UTC

[S2] Is there some BigDecimal validator and conversion routines?

Hi,

I want to enter numeric data in my form and I want it to go into a
BigDecimal action value, however it seems that I can't validate it
using some "bigdecimal" validator in the *-validation.xml file.

There is a double validator, but I don't know if it will introduce
rounding or truncation errors into my BigDecimal value.

Any ideas?

TIA,
Gabriel

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Is there some BigDecimal validator and conversion routines?

Posted by Gabriel Belingueres <be...@gmail.com>.
Seems that conversion to/from BigDecimal is covered by XWorks already.
I'm thinking in base the bigdecimal validator from the double
validator source code.

2007/8/2, Rene Gielen <gi...@it-neering.net>:
> You are right, there is no bundled BigDecimal related validator in
> place, but it should be quite easy to implement (eg. extend
> FieldValidatorSupport). For registering, see
> http://cwiki.apache.org/confluence/display/WW/Validation
>
> BTW, is it really validation you are searching for, or is it conversion
> (or both)? Note that these are two different topics.
>
> Regards,
> Rene
>
> Gabriel Belingueres schrieb:
> > Hi,
> >
> > I want to enter numeric data in my form and I want it to go into a
> > BigDecimal action value, however it seems that I can't validate it
> > using some "bigdecimal" validator in the *-validation.xml file.
> >
> > There is a double validator, but I don't know if it will introduce
> > rounding or truncation errors into my BigDecimal value.
> >
> > Any ideas?
> >
> > TIA,
> > Gabriel
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Is there some BigDecimal validator and conversion routines?

Posted by Rene Gielen <gi...@it-neering.net>.
You are right, there is no bundled BigDecimal related validator in
place, but it should be quite easy to implement (eg. extend
FieldValidatorSupport). For registering, see
http://cwiki.apache.org/confluence/display/WW/Validation

BTW, is it really validation you are searching for, or is it conversion
(or both)? Note that these are two different topics.

Regards,
Rene

Gabriel Belingueres schrieb:
> Hi,
> 
> I want to enter numeric data in my form and I want it to go into a
> BigDecimal action value, however it seems that I can't validate it
> using some "bigdecimal" validator in the *-validation.xml file.
> 
> There is a double validator, but I don't know if it will introduce
> rounding or truncation errors into my BigDecimal value.
> 
> Any ideas?
> 
> TIA,
> Gabriel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org