morten      01/10/22 00:40:39

  Modified:    java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
  Log:
  Fixed output formatting of some floating point numbers.
  PR:           n/a
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.23      +11 -1     
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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- BasisLibrary.java 2001/10/18 11:18:26     1.22
  +++ BasisLibrary.java 2001/10/22 07:40:39     1.23
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: BasisLibrary.java,v 1.22 2001/10/18 11:18:26 morten Exp $
  + * @(#)$Id: BasisLibrary.java,v 1.23 2001/10/22 07:40:39 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -151,6 +151,16 @@
            // DOM and not just a single node - that would not make sense.
            //return ((DOM)obj).getNodeValue(node);
            return ((DOM)obj).getStringValue();
  +     }
  +     else if (obj instanceof Double) {
  +         Double d = (Double)obj;
  +         final String result = d.toString();
  +         final int length = result.length();
  +         if ((result.charAt(length-2)=='.') &&
  +             (result.charAt(length-1) == '0'))
  +             return result.substring(0, length-2);
  +         else
  +             return result;
        }
        else {
            if (obj != null)
  
  
  

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

Reply via email to