morten      01/09/25 13:47:20

  Modified:    java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
  Log:
  Another little update to format-number() to make sure it returns
  "Infinity" and "-Infinity" for infinite numbers.
  PR:           bugzilla 2889
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.20      +7 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
  
  Index: BasisLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- BasisLibrary.java 2001/09/25 20:42:31     1.19
  +++ BasisLibrary.java 2001/09/25 20:47:20     1.20
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: BasisLibrary.java,v 1.19 2001/09/25 20:42:31 morten Exp $
  + * @(#)$Id: BasisLibrary.java,v 1.20 2001/09/25 20:47:20 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -838,7 +838,12 @@
       public static String formatNumber(double number, String pattern,
                                      DecimalFormat formatter) {
        try {
  -         if (Double.isNaN(number)) return("NaN");
  +         if (Double.isNaN(number))
  +             return("NaN");
  +         else if (number == Double.NEGATIVE_INFINITY) 
  +             return("-Infinity");
  +         else if (number == Double.POSITIVE_INFINITY)
  +             return("Infinity");
            StringBuffer result = new StringBuffer();
            formatter.applyLocalizedPattern(pattern);
            formatter.format(number,result,_fieldPosition);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to