API 0.9.5
CPNumberFormatter Class Reference

#import <CPNumberFormatter.h>

Inheritance diagram for CPNumberFormatter:

List of all members.

Instance Methods

(CPString- editingStringForObjectValue:
(void) - encodeWithCoder:
(BOOL) - getObjectValue:forString:errorDescription:
(id) - init
(id) - initWithCoder:
(CPUInteger) - maximalFractionalDigits
(CPNumber- numberFromString:
(CPNumberFormatterStyle) - numberStyle
(CPString- perMillSymbol
(CPNumberFormatterRoundingMode) - roundingMode
(void) - setMaximalFractionalDigits:
(void) - setMaximumFractionDigits:
(void) - setNumberStyle:
(void) - setPerMillSymbol:
(void) - setRoundingMode:
(CPString- stringForObjectValue:
(CPString- stringFromNumber:

Detailed Description

CPNumberFormatter takes a numeric NSNumber 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

- (CPString) editingStringForObjectValue: (id)  anObject

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 125 of file CPNumberFormatter.j.

- (void) encodeWithCoder: (CPCoder aCoder

Reimplemented from CPFormatter.

Definition at line 180 of file CPNumberFormatter.j.

- (BOOL) getObjectValue: (id)  anObject
forString: (CPString aString
errorDescription: (CPString anError 

Definition at line 130 of file CPNumberFormatter.j.

- (id) init

Definition at line 63 of file CPNumberFormatter.j.

- (id) initWithCoder: (CPCoder aCoder

Reimplemented from CPFormatter.

Definition at line 168 of file CPNumberFormatter.j.

- (CPUInteger) maximalFractionalDigits

Synthesized accessor method.

Definition at line 242 of file CPNumberFormatter.j.

- (CPNumber) numberFromString: (CPString string

Definition at line 111 of file CPNumberFormatter.j.

- (CPNumberFormatterStyle) numberStyle

Synthesized accessor method.

Definition at line 194 of file CPNumberFormatter.j.

- (CPString) perMillSymbol

Synthesized accessor method.

Definition at line 210 of file CPNumberFormatter.j.

- (CPNumberFormatterRoundingMode) roundingMode

Synthesized accessor method.

Definition at line 226 of file CPNumberFormatter.j.

- (void) setMaximalFractionalDigits: (CPUInteger)  aValue

Synthesized accessor method.

Definition at line 250 of file CPNumberFormatter.j.

- (void) setMaximumFractionDigits: (CPUInteger)  aNumber

Definition at line 156 of file CPNumberFormatter.j.

- (void) setNumberStyle: (CPNumberFormatterStyle)  aValue

Synthesized accessor method.

Definition at line 202 of file CPNumberFormatter.j.

- (void) setPerMillSymbol: (CPString aValue

Synthesized accessor method.

Definition at line 218 of file CPNumberFormatter.j.

- (void) setRoundingMode: (CPNumberFormatterRoundingMode)  aValue

Synthesized accessor method.

Definition at line 150 of file CPNumberFormatter.j.

- (CPString) stringForObjectValue: (id)  anObject

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 117 of file CPNumberFormatter.j.

- (CPString) stringFromNumber: (CPNumber number

Definition at line 74 of file CPNumberFormatter.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines