API  1.0.0
CPNumberFormatter Class Reference

#import <CPNumberFormatter.h>

+ Inheritance diagram for CPNumberFormatter:

Instance Methods

(CPString- currencyCode
 
(CPString- currencySymbol
 
(CPString- editingStringForObjectValue:
 
(void) - encodeWithCoder:
 
(BOOL) - generatesDecimalNumbers
 
(BOOL) - getObjectValue:forString:errorDescription:
 
(CPString- groupingSeparator
 
(id) - init
 
(id) - initWithCoder:
 
(CPUInteger) - maximum
 
(CPUInteger) - maximumFractionDigits
 
(CPUInteger) - minimum
 
(CPUInteger) - minimumFractionDigits
 
(CPNumber- numberFromString:
 
(CPNumberFormatterStyle) - numberStyle
 
(CPString- perMillSymbol
 
(CPNumberFormatterRoundingMode) - roundingMode
 
(void) - setCurrencyCode:
 
(void) - setCurrencySymbol:
 
(void) - setGeneratesDecimalNumbers:
 
(void) - setGroupingSeparator:
 
(void) - setMaximum:
 
(void) - setMaximumFractionDigits:
 
(void) - setMinimum:
 
(void) - setMinimumFractionDigits:
 
(void) - setNumberStyle:
 
(void) - setPerMillSymbol:
 
(void) - setRoundingMode:
 
(CPString- stringForObjectValue:
 
(CPString- stringFromNumber:
 
- Instance Methods inherited from CPFormatter
(BOOL) - isPartialStringValid:newEditingString:errorDescription:
 
(BOOL) - isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPString+ localizedStringFromNumber:numberStyle:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

CPNumberFormatter takes a numeric CPNumber value and formats it as text for display. It also supports the converse, taking text and interpreting it as a CPNumber by configurable formatting rules.

Definition at line 2 of file CPNumberFormatter.h.

Method Documentation

◆ currencyCode()

- (CPString) currencyCode
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 475 of file CPNumberFormatter.j.

◆ currencySymbol()

- (CPString) currencySymbol
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 491 of file CPNumberFormatter.j.

◆ editingStringForObjectValue:()

- (CPString) editingStringForObjectValue: (id)  anObject
implementation

The default implementation of this method invokes stringForObjectValue:.

When implementing a subclass, override this method only when the string that users see and the string that they edit are different. In your implementation, return an CPString object that is used for editing, following the logic recommended for implementing stringForObjectValue:. As an example, you would implement this method if you want the dollar signs in displayed strings removed for editing.

Parameters
anObjectthe object for which to return an editing string
Returns
CPString object that is used for editing the textual representation of an object

Reimplemented from CPFormatter.

Definition at line 184 of file CPNumberFormatter.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPFormatter.

Provided by category CPNumberFormatter(CPCoding).

Definition at line 324 of file CPNumberFormatter.j.

◆ generatesDecimalNumbers()

- (BOOL) generatesDecimalNumbers
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 507 of file CPNumberFormatter.j.

◆ getObjectValue:forString:errorDescription:()

- (BOOL) getObjectValue: (idRef)  anObject
forString: (CPString aString
errorDescription: (CPStringRef)  anError 
implementation

The default implementation of this method raises an exception.

When implementing a subclass, return by reference the object anObject after creating it from aString. Return YES if the conversion is successful. If you return NO, also return by reference (in anError) a localized user-presentable CPString object that explains the reason why the conversion failed; the delegate (if any) of the CPControl object can then respond to the failure in control:didFailToFormatString:errorDescription:. However, if anError is nil, the sender is not interested in the error description, and you should not attempt to assign one.

Parameters
anObjectif conversion is successful, upon return contains the object created from the string
aStringthe string to parse.
anErrorif non-nil, if there is an error during the conversion, upon return contains an CPString object that describes the problem.
Returns
BOOL YES if the conversion from the string to a view content object was successful, otherwise NO.

Reimplemented from CPFormatter.

Definition at line 189 of file CPNumberFormatter.j.

◆ groupingSeparator()

- (CPString) groupingSeparator
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 379 of file CPNumberFormatter.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 72 of file CPNumberFormatter.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPFormatter.

Provided by category CPNumberFormatter(CPCoding).

Definition at line 300 of file CPNumberFormatter.j.

◆ localizedStringFromNumber:numberStyle:()

+ (CPString) localizedStringFromNumber: (CPNumber num
numberStyle: (CPNumberFormatterStyle)  localizationStyle 
implementation

Definition at line 160 of file CPNumberFormatter.j.

◆ maximum()

- (CPUInteger) maximum
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 459 of file CPNumberFormatter.j.

◆ maximumFractionDigits()

- (CPUInteger) maximumFractionDigits
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 427 of file CPNumberFormatter.j.

◆ minimum()

- (CPUInteger) minimum
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 443 of file CPNumberFormatter.j.

◆ minimumFractionDigits()

- (CPUInteger) minimumFractionDigits
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 411 of file CPNumberFormatter.j.

◆ numberFromString:()

- (CPNumber) numberFromString: (CPString aString
implementation

Definition at line 168 of file CPNumberFormatter.j.

◆ numberStyle()

- (CPNumberFormatterStyle) numberStyle
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 347 of file CPNumberFormatter.j.

◆ perMillSymbol()

- (CPString) perMillSymbol
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 363 of file CPNumberFormatter.j.

◆ roundingMode()

- (CPNumberFormatterRoundingMode) roundingMode
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 395 of file CPNumberFormatter.j.

◆ setCurrencyCode:()

- (void) setCurrencyCode: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 483 of file CPNumberFormatter.j.

◆ setCurrencySymbol:()

- (void) setCurrencySymbol: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 499 of file CPNumberFormatter.j.

◆ setGeneratesDecimalNumbers:()

- (void) setGeneratesDecimalNumbers: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 515 of file CPNumberFormatter.j.

◆ setGroupingSeparator:()

- (void) setGroupingSeparator: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 387 of file CPNumberFormatter.j.

◆ setMaximum:()

- (void) setMaximum: (CPUInteger)  aNumber
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 266 of file CPNumberFormatter.j.

◆ setMaximumFractionDigits:()

- (void) setMaximumFractionDigits: (CPUInteger)  aNumber
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 254 of file CPNumberFormatter.j.

◆ setMinimum:()

- (void) setMinimum: (CPUInteger)  aNumber
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 260 of file CPNumberFormatter.j.

◆ setMinimumFractionDigits:()

- (void) setMinimumFractionDigits: (CPUInteger)  aNumber
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 248 of file CPNumberFormatter.j.

◆ setNumberStyle:()

- (void) setNumberStyle: (CPNumberFormatterStyle)  aStyle
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 222 of file CPNumberFormatter.j.

◆ setPerMillSymbol:()

- (void) setPerMillSymbol: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 371 of file CPNumberFormatter.j.

◆ setRoundingMode:()

- (void) setRoundingMode: (CPNumberFormatterRoundingMode)  aRoundingMode
implementation

Synthesized accessor method.

Provided by category CPNumberFormatter(CPSynthesizedAccessors).

Definition at line 242 of file CPNumberFormatter.j.

◆ stringForObjectValue:()

- (CPString) stringForObjectValue: (id)  anObject
implementation

The default implementation of this method raises an exception.

When implementing a subclass, return the CPString object that textually represents the view's object for display and if editingStringForObjectValue: is unimplemented for editing. First test the passed-in object to see if it's of the correct class. If it isn't, return nil; but if it is of the right class, return a properly formatted and, if necessary, localized string. (See the specification of the CPString class for formatting and localizing details.)

Parameters
anObjectThe object for which a textual representation is returned
Returns
CPSting a formatted string

Reimplemented from CPFormatter.

Definition at line 176 of file CPNumberFormatter.j.

◆ stringFromNumber:()

- (CPString) stringFromNumber: (CPNumber number
implementation

Definition at line 92 of file CPNumberFormatter.j.


The documentation for this class was generated from the following files: