• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFNumberFormatterCreate question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFNumberFormatterCreate question


  • Subject: CFNumberFormatterCreate question
  • From: Dmitry Markman <email@hidden>
  • Date: Sat, 03 Oct 2009 08:07:54 -0400

Hi,
I'd like to emulate .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@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: releasing a object containing others in a array
  • Next by Date: Re: objc_atomicCompareAndSwapInstanceVariable
  • Previous by thread: Re: objc_atomicCompareAndSwapInstanceVariable
  • Next by thread: whether to use core data...
  • Index(es):
    • Date
    • Thread