Issue 2409: Clarify legal values for the MoneyFormatter format strings (currency-rtf) Source: (, ) Nature: Revision Severity: Summary: Summary: Clarify legal values for the MoneyFormatter format strings Resolution: resolved by Currency 2 RTF Revised Text: Resolution: Add text to spec. to make it more clear what are valid format strings. Revised Text: Replace section 2.3.12.3 text for methods [gs]etFormattingString to: There are operations to get and set the formatting string. The formatting string determines the format of the money amount. The format is passed in as "positive string" or "positive string; negative string." The user can define what symbols to use for each piece of the formatting string or use the defaults assigned by the implementor. The "positive string" represents the format specification to use when the Money being formatted represents a value greater than or equal to zero(0), ';' represents the patterFormatSeparator, and "negative string" represents the format specification to use when the Money being formatted represents a value less than zero(0). If the string is not one of these forms, an FbcException will be raised. If there is no explicit negative subspecification (i.e., the string is presented as "positive string"), it will automatically be interpreted as "positive string;-positive string", where '-' represents the patternNegativePrefix. For example, "M #,###.00" is functionally equivalent to "M #,###.000;-M #,###.000. If there is an explicit negative subspecification, it serves only to specify the location of the patternNegativePrefix. The number of digits, minimal digits, conditional digits, grouping digits, and other characteristics are all the same as specified in the positive subspecification. The string can contain one and only one patternFormatSeparator, and one and only one patternNegativePrefix (in the negative subspecification only, of course). The subspecifications of the string, positive or negative, may contain the following: zero or more patternCurrencySymbol, zero or more patternFractionSymbol, zero or one patternRadix, zero or more patternGrouping, zero or more patternDigit, zero or more patternconditionalDigit, zero or more patternMnemonicSymbol. If the string contains multiple grouping patterns, the interval between the last one and the radix pattern is the last one that is used. Thus "#,##,###,####.00" has the same effect as "######,####,00" as does "##,####,####.00". The caller defines the string in terms of any desired wchars. Thus, if a wchar present in the string is one of the pattern values, it then becomes literal text and always appears in formatted output, e.g., if the string is set to "AbC M##.00" and 100.00 US Dollars were to be formatted, the formatted output from the MoneyFormatter, for the given state identifier would be "AbC USD 100.00". The string is retained as presented and is not automatically updated to reflect changes in pattern values for the given state identifier, i.e., if the string was successfully set to "M ##.00", with the pattern currency mnemonic being 'M' and is subsequently changed to 'N', the string is retained as "M ##.00". Thus, in subsequent format requests, the M will NOT be interpreted as the currency mnemonic pattern. Actions taken: January 11, 1999: received issue May 4, 2000: closed issue Discussion: End of Annotations:===== Issue Title: Clarify legal values for the MoneyFormatter format strings Issue Type: Text Revision Issue Description: There are nine patterns which may be used to define the format specification (via setFormattingString()) to be used to format Money instances on behalf of a given stateIdentifier. The FbcCurrency level text does not describe what a legal format specification is. How many radix placeholders can be present in a given format specification? Grouping placeholders? negative prefix placeholders (just one I would imagine)? Currency mnemonic placeholder (limiting to at most one does not seem right)? Can the format specification be an empty string or one consisting of white space only? The text needs to explicitly state what is legal concerning all nine placeholder patterns or lack thereof. Of the nine placeholder patterns and their respective mutators (e.g. setPatternGrouping). There is no text describing the legal value lists for the wchar argument that they take. Can the wchar argument be any wide character or must it be one which is printable? Concerning the nine patterns which can be used to define a format specification (e.g setPatternRadix(), setPatternGrouping(), etc.). The patterns MUST be distinct from o ne another INVALID_VALUE, and the submission text should be changed to talk about this. Add text for formatter that the format string will be used for parsing. Clarify the formatting string and how it is used. This way the parser routine will use: M##,###.00 to help it parse: RUR10,00 This also means the radix character was set to: . Thus exception should be thrown if the radix pattern is attempted to be set to M , and the grouping symbol was set to:i Show an example to distinguish between what the pattern gives you and what the actual settings of the characters give you. Add: If you supply a format string with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####". setFormattingString() needs to be a bit more explicit. It would be beneficial to use the description provided in the JDK regarding java.text.DecimalFormat : If there is no explicit negative subpattern, - is prefixed to the positive form. That is,f alone is equivalent to . If there is an explicit negative pattern, it serves only to specify the negative prefix and suffix. The number of digits, minimal digits, grouping digits, and other characteristics are all the same as the positive pattern. That means thatt has precisely the same result ash .e currency mnemonic pattern for a given stateIdentifier is currently M