How can I format a decimal in xquery?
I'm trying to format decimals in XQuery. The decimals are currency, so the format should be ,###.## . For example: 5573652.23 should be 5,573,652.23 and 352769 should be 352,769 (or 352,769.00 if it's easier/cleaner) Right now I'm using this function from http://www.xqueryhacker.com/2009/09/format-number-in-xquery/ , but I can't use decimals with it: declare function local:format-int($i as xs:int) as xs:string { let $input := if ($i lt 0) then fn:substring(fn:string($i), 2) else fn:string($i) let $rev := fn:reverse(fn:string-to-codepoints(fn:string($input))) let $comma := fn:string-to