Interestingly enough the xdmp:format-number uses the date picture string not the number picture string. http://docs.marklogic.com/xdmp:format-number " For details on the picture string, see http://www.w3.org/TR/xslt20/#date-picture-string. "
Given that I still cant get it to do what you want ... I cant read from the specs the correct way to add grouping and the arguments seem not to do it. (bug?) For now I suggest using fn:format-number() fn:format-number(2953,"#,##0") => 2,953 From: [email protected] [mailto:[email protected]] On Behalf Of Geert J. Sent: Tuesday, January 21, 2014 9:14 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] xdmp:format-number broken? Hi David, What kind of picture were you thinking of then? A picture like #,##0 returns #,##12312312.. :-/ Cheers, Geert Van: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] Namens David Lee Verzonden: dinsdag 21 januari 2014 15:10 Aan: MarkLogic Developer Discussion Onderwerp: Re: [MarkLogic Dev General] xdmp:format-number broken? With a picture like "0" the grouping and size are going to be ignored. Although it does seem odd to have what seems conflicting parameters in the same call. From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Geert J. Sent: Tuesday, January 21, 2014 3:21 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] xdmp:format-number broken? Doesn't work at my end, running MarkLogic 7.0-1. I suggest filing a report at support. Cheers, Geert Van: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] Namens William Sawyer Verzonden: zaterdag 18 januari 2014 0:38 Aan: [email protected]<mailto:[email protected]> Onderwerp: [MarkLogic Dev General] xdmp:format-number broken? Has anyone been able to to get xdmp:format-number grouping-separator and group-size parameters to work? let $value := 12312312 let $picture := "0" let $language := "en" let $letter-value := () let $ordchar := () let $zero-padding := () let $grouping-separator := "," let $grouping-size := 3 return ( xdmp:format-number($value, $picture, $language, $letter-value, $ordchar, $zero-padding, $grouping-separator, $grouping-size) ) **** RESULT **** 12312312
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
