> Please review this PR, which addresses a case where Decimal Format would
> violate certain RoundingMode contracts given the right pattern and input
> decimal String.
>
> For example,
>
>
> DecimalFormat df = new DecimalFormat();
> df.setRoundingMode(RoundingMode.UP);
> double small = 0.0001;
On Wed, 24 May 2023 18:47:45 GMT, Joe Darcy wrote:
>>> I just wonder if it is ok to reverse the rounding/truncation only in this
>>> special case. If the truncation always comes first, then 0.00 would be
>>> correct (then 1.01 may be something wrong). Looks to me that the original
>>> comment
> Please review this PR, which addresses a case where Decimal Format would
> violate certain RoundingMode contracts given the right pattern and double.
>
> For example,
>
>
> DecimalFormat df = new DecimalFormat();
> df.setRoundingMode(RoundingMode.UP);
> double small = 0.0001;
> double big = 1
On Wed, 24 May 2023 18:36:39 GMT, Justin Lu wrote:
> > I just wonder if it is ok to reverse the rounding/truncation only in this
> > special case. If the truncation always comes first, then 0.00 would be
> > correct (then 1.01 may be something wrong). Looks to me that the original
> > comment
On Wed, 24 May 2023 17:36:50 GMT, Naoto Sato wrote:
> I just wonder if it is ok to reverse the rounding/truncation only in this
> special case. If the truncation always comes first, then 0.00 would be
> correct (then 1.01 may be something wrong). Looks to me that the original
> comment suggest
On Tue, 23 May 2023 23:16:01 GMT, Justin Lu wrote:
> Please review this PR, which addresses a case where Decimal Format would
> violate certain RoundingMode contracts given the right pattern and double.
>
> For example,
>
>
> DecimalFormat df = new DecimalFormat();
> df.setRoundingMode(Roundi
On Tue, 23 May 2023 23:30:11 GMT, Joe Darcy wrote:
> Note there are some hazards here with respect to the numerical values of
> double and the decimal string used to represent the double; in exact terms:
>
> ```
> jshell> new BigDecimal(1.0001)
> $2 ==> 1.88986587595718447118997
On Tue, 23 May 2023 23:16:01 GMT, Justin Lu wrote:
> Please review this PR, which addresses a case where Decimal Format would
> violate certain RoundingMode contracts given the right pattern and double.
>
> For example,
>
>
> DecimalFormat df = new DecimalFormat();
> df.setRoundingMode(Roundi
Please review this PR, which addresses a case where Decimal Format would
violate certain RoundingMode contracts given the right pattern and double.
For example,
DecimalFormat df = new DecimalFormat();
df.setRoundingMode(RoundingMode.UP);
double small = 0.0001;
double big = 1.0001;
df.applyPatte