Do you specify version="1.0" or version="2.0" in your stylesheets? It's probably better to specify 2.0, because arithmetic is more likely then to result in an integer or decimal value rather than a double, and only doubles will be formatted in exponential notation.
 
However, an expression such as (@x + 1) will still return a double, which you could avoid by doing xs:integer(@x) + 1.
 
Of course, schema-awareness would help as well, but that may not be a practical option.
 
Apart from that, it's difficult to give advice without seeing the code that causes the problem. 
 
Generally rather than using format-number to display the double value differently, I would look at why the value is a double in the first place, and change the code to ensure that it is an integer or decimal instead.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Andrei.Mihu@MandG.co.UK [mailto:Andrei.Mihu@MandG.co.UK]
Sent: 20 August 2009 14:13
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Saxon 9.1 and scientific notation


Hello,

I have an application that uses Saxon 6.5.3 and XSLT 1.0 (mostly).

This is currently being upgraded to Saxon 9.1 (with Saxon 9.2 a possibility) and I've run into some issues.

Some of the numbers being processed are coming out in scientific notation and it's giving me no end of trouble. From what I've read this is expected behaviour when numbers are outside a certain range (outside 10^6 to 10^-6 or so i believe) and I am aware of the format-number function.

My question is if there is any way around using format-number() as the application uses a significant number of stylesheets which would need changing and the format required is not consistent across numeric fields. Possibly a way to disable this behaviour from within Saxon or another solution?

Any help or suggestions would be most welcome!

Regards,

Andrei Mihu

The information contained in this message may be CONFIDENTIAL and is intended for the addressee only. Any unauthorised use, dissemination of the information, or copying of this message is prohibited. If you are not the addressee, please notify the sender immediately by return e-mail and delete this message. Although this e-mail and any attachments are believed to be free of any virus, or other defect which might affect any computer or system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by M & G for any loss or damage from receipt or use thereof. Please note that all e-mail messages are subject to interception for lawful business purposes.

M & G Limited is incorporated and registered in England and Wales under registered number 1048359. Registered office: Laurence Pountney Hill, London, EC4R 0HH. M & G Limited is a wholly owned subsidiary of Prudential plc.