From: Dan M. <dan...@gm...> - 2010-07-15 19:13:22
|
My apologies, I was aware of the XQuery 1.1 specification for *format-number()* but I did not communicate this format clearly to Loren. Here is the proposed format in the 1.1 XQuery Working Draft standard: http://www.w3.org/TR/xquery-11/#id-decimal-format-decl I believe we should be working to try to make it consistent with this specification (i.e. also XPath 2.0) - Dan On Thu, Jul 15, 2010 at 12:39 PM, Loren Cahlander <lor...@gm... > wrote: > I am in the process of adding the formatting of a number to a formatted > string. There are three general purpose functions that format the number to > a general number, currency or percentage according to the optionally > specified locale. The fourth function takes in a format string according to > the format specification for the java.text.DecimalFormat Java class. > > Please supply me with your comments. Dan will be developing XQuery unit > tests to validate the functions. You will find the function docs below. > > Thank you, > > Loren > > > > number-to-currency-string<http://localhost:8080/exist/functions/util/number-to-currency-string> > ------------------------------ > util:number-to-currency-string($number as xs:double, $locale as xs:string?) > xs:string? > Returns a currency number formatted for the specified locale if specified > (default otherwise) as an xs:string value. > $numberThe number$localetwo-letter ISO-639 code representing the locale > ------------------------------ > Returns the formatted string > number-to-formatted-string<http://localhost:8080/exist/functions/util/number-to-formatted-string> > ------------------------------ > util:number-to-formatted-string($number as xs:double, $format as xs:string) > xs:string? > Returns the number formatted as an xs:string value. > $numberThe number$formatThe format pattern string. Please see the JavaDoc > for java.text.DecimalFormat to get the specifics of this format string. > ------------------------------ > Returns the formatted string > number-to-percent-string<http://localhost:8080/exist/functions/util/number-to-percent-string> > ------------------------------ > util:number-to-percent-string($number as xs:double, $locale as xs:string?) > xs:string? > Returns a percentage number formatted for the specified locale if specified > (default otherwise) as an xs:string value. > $numberThe number$localetwo-letter ISO-639 code representing the locale > ------------------------------ > Returns the formatted string > number-to-string<http://localhost:8080/exist/functions/util/number-to-string> > ------------------------------ > util:number-to-string($number as xs:double, $locale as xs:string?) > xs:string? > Returns a general-purpose number formatted for the specified locale if > specified (default otherwise) as an xs:string value. > $numberThe number$localetwo-letter ISO-639 code representing the locale > ------------------------------ > Returns the formatted string > > > > -- Dan McCreary Semantic Solutions Architect office: (952) 931-9198 cell: (612) 986-1552 |