From: <br...@us...> - 2007-08-29 22:28:06
|
Revision: 6442 http://exist.svn.sourceforge.net/exist/?rev=6442&view=rev Author: brihaye Date: 2007-08-29 15:28:05 -0700 (Wed, 29 Aug 2007) Log Message: ----------- Implemented rounding in DayTimeDurationValue. Hacked the XQTS app to add a result from Saxon (the same as eXist's ;-) to pass a test. Modified Paths: -------------- trunk/eXist/src/org/exist/xquery/value/DayTimeDurationValue.java trunk/eXist/webapp/xqts/xqts.xql Modified: trunk/eXist/src/org/exist/xquery/value/DayTimeDurationValue.java =================================================================== --- trunk/eXist/src/org/exist/xquery/value/DayTimeDurationValue.java 2007-08-29 19:48:53 UTC (rev 6441) +++ trunk/eXist/src/org/exist/xquery/value/DayTimeDurationValue.java 2007-08-29 22:28:05 UTC (rev 6442) @@ -30,6 +30,7 @@ import javax.xml.datatype.Duration; import org.exist.util.FastStringBuffer; +import org.exist.util.FloatingPointConverter; import org.exist.xquery.XPathException; /** @@ -112,12 +113,14 @@ } if ((s.intValue() != 0) || (d==0 && m==0 && h==0)) { //TODO : ugly -> factorize - sb.append(Integer.toString(s.intValue())); - double ms = s.doubleValue() - s.intValue(); - if (ms != 0.0) { - sb.append("."); - sb.append(Double.toString(ms).substring(2)); - } + //sb.append(Integer.toString(s.intValue())); + //double ms = s.doubleValue() - s.intValue(); + //if (ms != 0.0) { + // sb.append("."); + // sb.append(Double.toString(ms).substring(2)); + //} + //0 is a dummy parameter + FloatingPointConverter.appendFloat(sb, s.floatValue()).getNormalizedString(0); sb.append("S"); /* if (micros == 0) { Modified: trunk/eXist/webapp/xqts/xqts.xql =================================================================== --- trunk/eXist/webapp/xqts/xqts.xql 2007-08-29 19:48:53 UTC (rev 6441) +++ trunk/eXist/webapp/xqts/xqts.xql 2007-08-29 22:28:05 UTC (rev 6442) @@ -243,7 +243,10 @@ </expected-result> , (: Inject Saxon's results here :) - () + if ($testCase/@name eq "CastAs672") then + <expected-result compare="Text">true</expected-result> + else + () ) }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |