Variation on using xsl

Jeska

New Member
I have an inconsistency while using xsl,here is the xml,\[code\]<Rate> <TotalRate>506.41</TotalRate> <TotalTax>17</TotalTax> <Currency>INR</Currency></Rate>\[/code\]and xsl,\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <TotalAmount> <xsl:value-of select="Rate/TotalRate + Rate/TotalTax"/> </TotalAmount> </xsl:template></xsl:stylesheet>\[/code\]and the output is,\[code\]<TotalAmount xmlns:fo="http://www.w3.org/1999/XSL/Format">523.4100000000001</TotalAmount>\[/code\]but the expected o/p is,\[code\]<TotalAmount xmlns:fo="http://www.w3.org/1999/XSL/Format">523.41</TotalAmount>\[/code\]Why the o/p is 523.4100000000001? how can i get 523.41 without rounding it?
 
Back
Top