|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Loosing Precision after Transformation
Has anyone had problems loosing precision after transforming a message using Xalan?? Problem: I have content stored in an element as follows <aNumber>12345.12345</aNumber> I format the content in this element for output as follows ( note: length 10 with 0 padding ) <xsl:value-of select="format-number(number*100000,'0000000000')"/> On the ouput I get 1234512344, which is off by .00001. I need the exact value on the source document. I tried a substring-before and substring-after the the decimal separator '.', then concatenated the total and fractional parts, then formatted as I have shown above, and I got the same thing. I know its loosing precision when the string is changed to a number, but the funny thing is, if a string less than the full length ( 10 in this case ) of the field is passed, all is well. Example <number>1234.12345</number> ----> 01234.12345 ( which makes me happy ) Does anyone know what approach I can use here to solve this problem? Thanking you in advance Garvin _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








