« SQL XML access pattern | Main | CSS Style Sheets Syntax Reference »

SQL XML, formatting floats, suppressing trailing zeroes

User round(val, digits) to round a floating point number to a specific number of decimal digits.

To avoid having lots of extra digits appear in the xml however, you can convert the float to a char. Trailing zeros then disappear from the xml. Go figure.

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)