Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Matias Rodriguez
Hi!
I noticed a behaviour change when migrating the referenced versions.
I know that there were changes about this (https://struts.apache.org/
docs/version-notes-2512.html).
I need to change the MaximumFractionDigits GLOBALLY, for example, from 3 to
10.
Is there a recommended way to do this (the "struts way")?
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Lukasz Lenart
2017-10-09 4:15 GMT+02:00 Matias Rodriguez <[hidden email]>:
> Hi!
> I noticed a behaviour change when migrating the referenced versions.
> I know that there were changes about this (https://struts.apache.org/
> docs/version-notes-2512.html).
> I need to change the MaximumFractionDigits GLOBALLY, for example, from 3 to
> 10.
> Is there a recommended way to do this (the "struts way")?

Sorry but I don't think so it is possible now. You have three options:
- re-implement NumberConverter based on built-in version and override
"convertToBigDecimal" method and then register it with
"struts.converter.number"
- implement your own global BigDecimal converter
- request a change via JIRA


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Yasser Zamani


On 10/9/2017 8:59 AM, Lukasz Lenart wrote:
> - request a change via JIRA

As Struts converts to/from strings, to keep backward-compatibility,
maybe it's better to setMaximumFractionDigits to possible max value that
can accepts; This avoids loss of user's data caused by rounding like
previous versions do.

Regards,
Yasser.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Matias Rodriguez
Thanks Lukasz & Yasser!
It would be great to keep backward-compatibility (no limit/max value). IMHO
the limitation should be done by a formatter, not in a converter,
delegating the formatting to the user's hands.
Thanks again.

On Mon, Oct 9, 2017 at 2:36 PM, Yasser Zamani <[hidden email]>
wrote:

>
>
> On 10/9/2017 8:59 AM, Lukasz Lenart wrote:
> > - request a change via JIRA
>
> As Struts converts to/from strings, to keep backward-compatibility,
> maybe it's better to setMaximumFractionDigits to possible max value that
> can accepts; This avoids loss of user's data caused by rounding like
> previous versions do.
>
> Regards,
> Yasser.
>
Reply | Threaded
Open this post in threaded view
|

Re: Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Yasser Zamani


On 10/13/2017 6:29 PM, Matias Rodriguez wrote:
> IMHO
> the limitation should be done by a formatter, not in a converter,
> delegating the formatting to the user's hands.

I agree. Please track the resolution on the JIRA ticket at [1].

Thanks for your report,
Yasser.

[1] https://issues.apache.org/jira/browse/WW-4871

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Decimal digits change when upgrading from 2.5.10.1 to 2.5.12

Matias Rodriguez
Great! Thank you!

El 14 oct. 2017 03:40, "Yasser Zamani" <[hidden email]> escribió:

>
>
> On 10/13/2017 6:29 PM, Matias Rodriguez wrote:
> > IMHO
> > the limitation should be done by a formatter, not in a converter,
> > delegating the formatting to the user's hands.
>
> I agree. Please track the resolution on the JIRA ticket at [1].
>
> Thanks for your report,
> Yasser.
>
> [1] https://issues.apache.org/jira/browse/WW-4871
>