This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14931 - [FO30] fn:format-number
Summary: [FO30] fn:format-number
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-25 09:51 UTC by Tim Mills
Modified: 2012-05-18 13:55 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2011-11-25 09:51:06 UTC
fn:format-number has the following signature for its 3-argument variant.

fn:format-number($value 	 as numeric?,
                 $picture 	 as xs:string,
                 $decimal-format-name 	 as xs:string) as xs:string

Might I suggest changing it to:

fn:format-number($value 	 as numeric?,
                 $picture 	 as xs:string,
                 $decimal-format-name 	 as xs:string?) as xs:string

with behaviour such that if the $decimal-format-name is the empty sequence, the default decimal format is used.

Thus 

fn:format-number($value, $picutre) 

would be equivalent to 

fn:format-number($valud, $picture, ())
Comment 1 Michael Kay 2011-11-28 23:37:04 UTC
I have no objection to this change. It's probably a good design principle that if there's a 3-argument form of a function and a 2-argument form, then there should always be a value for the 3rd argument that makes the call equivalent to the 2-argument form.
Comment 2 Tim Mills 2011-11-29 13:52:46 UTC
I think the two-argument format should also be marked context-dependent.
Comment 3 Jim Melton 2012-01-11 19:47:47 UTC
In their Joint teleconference on 2011-12-06, the WGs decided to accept the proposal for the 3rd argument to fn:format-number to become xs:string?

I am not marking this bug RESOLVED pending the completion of the changes to F&O 3.0.
Comment 4 Michael Kay 2012-05-16 21:51:29 UTC
The accepted changes have been applied to the spec baseline, so I am marking this resolved/fixed.
Comment 5 Tim Mills 2012-05-18 13:55:56 UTC
Thanks.