Hi,
I'd like to emulate %15.4g format with CFNumberFormatterCreate

I have a problem with padding for exponential notation

patterns like
* ##...@###e00 don't work

Note: pattern * ##...@### works fine

icu returns error for patterns like * ##...@###e00
from other hand
documentation for decimal format allows patterns like * ##...@###e00 (as far as I can see)

 pattern    := subpattern (';' subpattern)?
 subpattern := prefix? number exponent? suffix?
 number     := (integer ('.' fraction)?) | sigDigits
 prefix     := '\u0000'..'\uFFFD' - specialCharacters
 suffix     := '\u0000'..'\uFFFD' - specialCharacters
 integer    := '#'* '0'* '0'
 fraction   := '0'* '#'*
 sigDigits  := '#'* '@' '@'* '#'*
 exponent   := 'E' '+'? '0'* '0'
 padSpec    := '*' padChar
 padChar    := '\u0000'..'\uFFFD' - quote

Not indicated in the BNF syntax above:
• The grouping separator ',' can occur inside the integer and sigDigits elements, between any two pattern characters of that element, as long as the integer or sigDigits element is not followed by the exponent element. • Two grouping intervals are recognized: That between the decimal point and the first grouping symbol, and that between the first and second grouping symbols. These intervals are identical in most locales, but in some locales they differ. For example, the pattern "#,##,###" formats the number 123456789 as "12,34,56,789". • The pad specifier padSpec may appear before the prefix, after the prefix, before the suffix, after the suffix, or not at all. • In place of '0', the digits '1' through '9' may be used to indicate a rounding increment.


thanks

Dmitry Markman

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to