Hello. Any feedback?

Guillermo

2015-01-30 14:28 GMT+01:00 Guillermo Rodriguez <guille.rodrig...@gmail.com>:
> When a negative subpattern is not explicitly defined,
> DecimalFormat was not using the positive suffix for
> negative values.
>
> Simple test case to reproduce the problem:
>
>   DecimalFormat tempFormat = new DecimalFormat("0.0 unit");
>   System.out.println(tempFormat.format(4.3));
>   System.out.println(tempFormat.format(-4.3));
>
> Yields:
>
> 4.3 unit
> -4.3
>
> ---
>  java/text/DecimalFormat.java |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/java/text/DecimalFormat.java b/java/text/DecimalFormat.java
> index 77af0d3..5e4bf76 100644
> --- a/java/text/DecimalFormat.java
> +++ b/java/text/DecimalFormat.java
> @@ -1371,6 +1371,7 @@ public class DecimalFormat extends NumberFormat
>      else
>        {
>          this.positiveSuffix = buffer.toString();
> +        this.negativeSuffix = positiveSuffix;
>        }
>
>      return i;
> --
> 1.7.0.4
>



-- 
Guillermo Rodriguez Garcia
guille.rodrig...@gmail.com

Reply via email to