[
https://issues.apache.org/jira/browse/WW-5711?focusedWorklogId=1038886&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1038886
]
ASF GitHub Bot logged work on WW-5711:
--------------------------------------
Author: ASF GitHub Bot
Created on: 31/Aug/26 18:51
Start Date: 31/Aug/26 18:51
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #1888:
URL: https://github.com/apache/struts/pull/1888#issuecomment-5482965926
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1888)
**Quality Gate passed**
Issues
 [1 New
issue](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1888&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1888&issueStatuses=ACCEPTED)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1888&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1888&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1888&metric=new_duplicated_lines_density&view=list)
<!
Issue Time Tracking
-------------------
Worklog Id: (was: 1038886)
Time Spent: 40m (was: 0.5h)
> StringConverter does not bound fraction digits when formatting BigDecimal
> -------------------------------------------------------------------------
>
> Key: WW-5711
> URL: https://issues.apache.org/jira/browse/WW-5711
> Project: Struts 2
> Issue Type: Bug
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 6.12.0, 7.4.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{StringConverter.convertToString()}} sets
> {{format.setMaximumFractionDigits(Integer.MAX_VALUE)}} for {{BigDecimal}},
> {{Double}} and {{Float}}.
> That constant arrived with WW-4871, which fixed round-trip precision loss
> when formatting {{double}} and {{float}}. Both of those types are naturally
> bounded — the widest {{double}} needs 325 fraction digits
> ({{Double.MIN_VALUE}}) and the widest {{float}} needs 45 — so
> {{Integer.MAX_VALUE}} is far wider than WW-4871 actually required.
> {{BigDecimal}} carries no such bound. {{DecimalFormat}} honours
> {{maximumFractionDigits}} literally and pads the fraction out to the value's
> full scale, so the length of the formatted output is driven by the scale of
> the value rather than by anything the formatter decides.
> Bound {{maximumFractionDigits}} to 340 instead. That preserves WW-4871's
> intent exactly — every {{double}} and {{float}} value still formats in full,
> as does every {{BigDecimal}} within that range — while making the output
> length independent of an arbitrarily large scale.
> Add a regression test covering the bound.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)