Hello Glen, One thing when doing calculations in XSL:
All these numbers are floats, therefore every calculation may give you unexpected rounding errors. http://www.w3.org/TR/xpath#section-Number-Functions Is there a way to avoid this? Thanks, Alex. > Alexander Schwartz PLUS Finanzservice GmbH Otto-von-Guericke-Ring 15 65205 Wiesbaden T.: 06122 - 999 906 F.: 06122 - 999 44906 [EMAIL PROTECTED] ------------------------------------------------------------------------------ Confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e-mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and its attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. ------------------------------------------------------------------------------ -----Ursprüngliche Nachricht----- > Von: Glen Mazza [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 20. Juli 2006 03:30 > An: [email protected] > Betreff: Re: marker value to variable [SOLVED] > > > *Very* impressive and clean solution, Andreas. I wish I could have > thought of that. > > Glen > > pat wrote: > > YES !!! That's it !!! That's the way :-) > > > > My problem was that I firstly counted the summary and then > I've try to > > split the fraction instead firstly count the integer and > fraction and > > then only disply them. > > > > Thanks a lot !!! > > > > Pat > > > > On Wed, 19 Jul 2006 18:26:22 +0200, Andreas L Delmelle wrote > > > >>On Jul 19, 2006, at 17:16, Andreas L Delmelle wrote: > >> > >><snip /> > >> > >>To illustrate what I mean (untested, but seems OK, for positive > >>numbers at least... gotta leave some to you ;)): > >> > >><xsl:template match="someNum"> > >> <xsl:variable name="vSum" select="sum(preceding::someNum)" /> > >> <xsl:variable name="vInt" select="floor($vSum)" /> > >> <xsl:variable name="vFrac" select="$vSum - $vInt" /> > >> > >> <fo:block> > >> <fo:marker marker-class-name="intMarker"> > >> <xsl:value-of select="$vInt" /> > >> </fo:marker> > >> <fo:marker marker-class-name="fracMarker"> > >> <xsl:value-of select="substring(string($vFrac),3))" /> > >> </fo:marker> > >> </fo:block> > >></xsl:template> > >> > >>and then > >> > >><xsl:template match="..."> > >> <fo:static-content> > >> ... > >> <xsl:text>integer part is </xsl:text> > >> <fo:retrieve-marker retrieve-class-name="intMarker" .../> > >> <xsl:text>fractional part is 0.</xsl:text> > >> <fo:retrieve-marker retrieve-class-name="fracMarker" .../> > >> ... > >></xsl:template> > >> > >>No? > >> > >>IOW: don't focus *too* much on retrieve-marker alone, perform both > >>sum and separation *before* creating the markers. > >>Plus the usual completions, of course, like 'take care of floor(); > >>for negative numbers use ceiling() to obtain the integer part' and > >>'take the absolute value of the fractional part'... > >> > >>HTH! > >> > >>Cheers, > >> > >>Andreas > >> > >>------------------------------------------------------------ > --------- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
