From: Dmitriy S. <sha...@gm...> - 2010-07-15 19:21:09
|
XSL have status recommendation & it have this function. eXist have this module http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/extensions/xslt/src/org/exist/xslt/functions/ (NOTE: the module namespace must be changed to http://www.w3.org/1999/XSL/Transform) -- Cheers, Dmitriy Shabanov On Thu, 2010-07-15 at 14:13 -0500, Dan McCreary wrote: > 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 > > ______________________________________________________________ > 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. > > > $number > The number > $locale > two-letter ISO-639 code > representing the locale > > ______________________________________________________________ > Returns the formatted string > 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. > > > $number > The number > $format > The 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 > > ______________________________________________________________ > 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. > > > $number > The number > $locale > two-letter ISO-639 code > representing the locale > > ______________________________________________________________ > Returns the formatted string > 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. > > > $number > The number > $locale > two-letter ISO-639 code > representing the locale > > ______________________________________________________________ > Returns the formatted string > > > > > > > > > > -- > Dan McCreary > Semantic Solutions Architect > office: (952) 931-9198 > cell: (612) 986-1552 > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ Exist-development mailing list Exi...@li... https://lists.sourceforge.net/lists/listinfo/exist-development |