2001-12-17 14:31:42 +00:00
|
|
|
/**
|
2000-09-02 01:44:24 +00:00
|
|
|
NSNumberFormatter class
|
|
|
|
Copyright (C) 2000 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Fred Kiefer <FredKiefer@gmx.de>
|
|
|
|
Created: July 2000
|
2001-10-19 09:10:04 +00:00
|
|
|
Updated by: Richard Frith-Macdonald <rfm@gnu.org> Sept 2001
|
2000-09-02 01:44:24 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
2001-12-18 16:54:15 +00:00
|
|
|
|
|
|
|
<title>NSNumberFormatter class reference</title>
|
|
|
|
$Date$ $Revision$
|
2000-09-02 01:44:24 +00:00
|
|
|
*/
|
|
|
|
|
2003-06-07 01:24:41 +00:00
|
|
|
#include "Foundation/NSDictionary.h"
|
2003-06-12 03:29:35 +00:00
|
|
|
#include "Foundation/NSException.h"
|
2003-06-07 01:24:41 +00:00
|
|
|
#include "Foundation/NSString.h"
|
|
|
|
#include "Foundation/NSAttributedString.h"
|
|
|
|
#include "Foundation/NSDecimalNumber.h"
|
|
|
|
#include "Foundation/NSNumberFormatter.h"
|
2000-09-02 01:44:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
@implementation NSNumberFormatter
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (BOOL) allowsFloats
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _allowsFloats;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSAttributedString*) attributedStringForObjectValue: (id)anObject
|
|
|
|
withDefaultAttributes: (NSDictionary*)attr
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
// FIXME
|
|
|
|
return AUTORELEASE([[NSAttributedString alloc] initWithString:
|
|
|
|
[self editingStringForObjectValue: anObject] attributes: attr]);
|
|
|
|
}
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSAttributedString*) attributedStringForNil
|
|
|
|
{
|
|
|
|
return _attributedStringForNil;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSAttributedString*) attributedStringForNotANumber
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _attributedStringForNotANumber;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSAttributedString*) attributedStringForZero
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _attributedStringForZero;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (id) copyWithZone: (NSZone *)zone
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
NSNumberFormatter *c = (NSNumberFormatter*) NSCopyObject(self, 0, zone);
|
|
|
|
|
|
|
|
RETAIN(c->_negativeFormat);
|
|
|
|
RETAIN(c->_positiveFormat);
|
|
|
|
RETAIN(c->_attributesForPositiveValues);
|
|
|
|
RETAIN(c->_attributesForNegativeValues);
|
|
|
|
RETAIN(c->_maximum);
|
|
|
|
RETAIN(c->_minimum);
|
|
|
|
RETAIN(c->_roundingBehavior);
|
|
|
|
RETAIN(c->_roundingBehavior);
|
|
|
|
RETAIN(c->_attributedStringForNil);
|
|
|
|
RETAIN(c->_attributedStringForNotANumber);
|
|
|
|
RETAIN(c->_attributedStringForZero);
|
|
|
|
|
|
|
|
return c;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) dealloc
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
RELEASE(_negativeFormat);
|
|
|
|
RELEASE(_positiveFormat);
|
|
|
|
RELEASE(_attributesForPositiveValues);
|
|
|
|
RELEASE(_attributesForNegativeValues);
|
|
|
|
RELEASE(_maximum);
|
|
|
|
RELEASE(_minimum);
|
|
|
|
RELEASE(_roundingBehavior);
|
|
|
|
RELEASE(_roundingBehavior);
|
|
|
|
RELEASE(_attributedStringForNil);
|
|
|
|
RELEASE(_attributedStringForNotANumber);
|
|
|
|
RELEASE(_attributedStringForZero);
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) decimalSeparator
|
|
|
|
{
|
|
|
|
if (_decimalSeparator == 0)
|
|
|
|
return @"";
|
|
|
|
else
|
|
|
|
return [NSString stringWithCharacters: &_decimalSeparator length: 1];
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) editingStringForObjectValue: (id)anObject
|
|
|
|
{
|
|
|
|
return [self stringForObjectValue: anObject];
|
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) encodeWithCoder: (NSCoder*)encoder
|
|
|
|
{
|
|
|
|
[encoder encodeValueOfObjCType: @encode(BOOL) at: &_hasThousandSeparators];
|
|
|
|
[encoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsFloats];
|
|
|
|
[encoder encodeValueOfObjCType: @encode(BOOL) at: &_localizesFormat];
|
|
|
|
[encoder encodeValueOfObjCType: @encode(unichar) at: &_thousandSeparator];
|
|
|
|
[encoder encodeValueOfObjCType: @encode(unichar) at: &_decimalSeparator];
|
|
|
|
|
2001-11-23 12:37:33 +00:00
|
|
|
[encoder encodeObject: _roundingBehavior];
|
|
|
|
[encoder encodeObject: _maximum];
|
|
|
|
[encoder encodeObject: _minimum];
|
|
|
|
[encoder encodeObject: _attributedStringForNil];
|
|
|
|
[encoder encodeObject: _attributedStringForNotANumber];
|
|
|
|
[encoder encodeObject: _attributedStringForZero];
|
|
|
|
[encoder encodeObject: _negativeFormat];
|
|
|
|
[encoder encodeObject: _positiveFormat];
|
|
|
|
[encoder encodeObject: _attributesForPositiveValues];
|
|
|
|
[encoder encodeObject: _attributesForNegativeValues];
|
2001-10-19 09:10:04 +00:00
|
|
|
}
|
2004-09-14 03:34:37 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSString*) format
|
|
|
|
{
|
|
|
|
if (_attributedStringForZero != nil)
|
|
|
|
{
|
|
|
|
return [NSString stringWithFormat: @"%@;%@;%@",
|
|
|
|
_positiveFormat, [_attributedStringForZero string], _negativeFormat];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return [NSString stringWithFormat: @"%@;%@",
|
|
|
|
_positiveFormat, _negativeFormat];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-02 01:44:24 +00:00
|
|
|
- (BOOL) getObjectValue: (id*)anObject
|
|
|
|
forString: (NSString*)string
|
|
|
|
errorDescription: (NSString**)error
|
|
|
|
{
|
2003-06-12 03:29:35 +00:00
|
|
|
/* FIXME: This is just a quick hack implementation. */
|
|
|
|
NSLog(@"NSNumberFormatter-getObjectValue:forString:... not implemented");
|
|
|
|
if (_positiveFormat == nil && _negativeFormat == nil)
|
|
|
|
{
|
|
|
|
/* Just assume nothing else has been setup and do a simple conversion. */
|
2004-09-14 03:34:37 +00:00
|
|
|
if (anObject)
|
|
|
|
{
|
|
|
|
*anObject = [NSDecimalNumber decimalNumberWithString: string];
|
|
|
|
}
|
2003-06-12 03:29:35 +00:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
return NO;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (BOOL) hasThousandSeparators
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _hasThousandSeparators;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (id) init
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-12-04 08:44:42 +00:00
|
|
|
id o;
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
_allowsFloats = YES;
|
|
|
|
_decimalSeparator = '.';
|
|
|
|
_thousandSeparator = ',';
|
2001-12-04 08:44:42 +00:00
|
|
|
o = [[NSAttributedString alloc] initWithString: @""];
|
|
|
|
[self setAttributedStringForNil: o];
|
|
|
|
RELEASE(o);
|
|
|
|
o = [[NSAttributedString alloc] initWithString: @"NaN"];
|
|
|
|
[self setAttributedStringForNotANumber: o];
|
|
|
|
RELEASE(o);
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
return self;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (id) initWithCoder: (NSCoder*)decoder
|
|
|
|
{
|
|
|
|
[decoder decodeValueOfObjCType: @encode(BOOL) at: &_hasThousandSeparators];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsFloats];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(BOOL) at: &_localizesFormat];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(unichar) at: &_thousandSeparator];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(unichar) at: &_decimalSeparator];
|
|
|
|
|
2001-12-04 08:44:42 +00:00
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_roundingBehavior];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_maximum];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_minimum];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_attributedStringForNil];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id)
|
|
|
|
at: &_attributedStringForNotANumber];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_attributedStringForZero];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_negativeFormat];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id) at: &_positiveFormat];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id)
|
|
|
|
at: &_attributesForPositiveValues];
|
|
|
|
[decoder decodeValueOfObjCType: @encode(id)
|
|
|
|
at: &_attributesForNegativeValues];
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
return self;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (BOOL) isPartialStringValid: (NSString*)partialString
|
|
|
|
newEditingString: (NSString**)newString
|
|
|
|
errorDescription: (NSString**)error
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
if (newString != NULL)
|
2004-09-14 03:34:37 +00:00
|
|
|
{
|
|
|
|
*newString = partialString;
|
|
|
|
}
|
|
|
|
if (error)
|
|
|
|
{
|
2004-09-14 15:55:18 +00:00
|
|
|
*error = nil;
|
2004-09-14 03:34:37 +00:00
|
|
|
}
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
return YES;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (BOOL) localizesFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _localizesFormat;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSDecimalNumber*) maximum
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _maximum;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSDecimalNumber*) minimum
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _minimum;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSString*) negativeFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _negativeFormat;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSString*) positiveFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _positiveFormat;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSDecimalNumberHandler*) roundingBehavior
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _roundingBehavior;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setAllowsFloats: (BOOL)flag
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
_allowsFloats = flag;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setAttributedStringForNil: (NSAttributedString*)newAttributedString
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_attributedStringForNil, newAttributedString);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setAttributedStringForNotANumber:
|
|
|
|
(NSAttributedString*)newAttributedString
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_attributedStringForNotANumber, newAttributedString);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setAttributedStringForZero: (NSAttributedString*)newAttributedString
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
|
|
|
ASSIGN(_attributedStringForZero, newAttributedString);
|
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setDecimalSeparator: (NSString*)newSeparator
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
if ([newSeparator length] > 0)
|
|
|
|
_decimalSeparator = [newSeparator characterAtIndex: 0];
|
|
|
|
else
|
|
|
|
_decimalSeparator = 0;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setFormat: (NSString*)aFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
NSRange r;
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
r = [aFormat rangeOfString: @";"];
|
|
|
|
if (r.length == 0)
|
|
|
|
{
|
|
|
|
[self setPositiveFormat: aFormat];
|
|
|
|
[self setNegativeFormat: [@"-" stringByAppendingString: aFormat]];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self setPositiveFormat: [aFormat substringToIndex: r.location]];
|
|
|
|
aFormat = [aFormat substringFromIndex: NSMaxRange(r)];
|
|
|
|
r = [aFormat rangeOfString: @";"];
|
|
|
|
if (r.length == 0)
|
|
|
|
{
|
|
|
|
[self setNegativeFormat: aFormat];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RELEASE(_attributedStringForZero);
|
|
|
|
_attributedStringForZero = [[NSAttributedString alloc] initWithString:
|
|
|
|
[aFormat substringToIndex: r.location]];
|
|
|
|
[self setNegativeFormat: [aFormat substringFromIndex: NSMaxRange(r)]];
|
|
|
|
}
|
|
|
|
}
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setHasThousandSeparators: (BOOL)flag
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
_hasThousandSeparators = flag;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setLocalizesFormat: (BOOL)flag
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
_localizesFormat = flag;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setMaximum: (NSDecimalNumber*)aMaximum
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_maximum, aMaximum);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setMinimum: (NSDecimalNumber*)aMinimum
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_minimum, aMinimum);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setNegativeFormat: (NSString*)aFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_negativeFormat, aFormat);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setPositiveFormat: (NSString*)aFormat
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_positiveFormat, aFormat);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setRoundingBehavior: (NSDecimalNumberHandler*)newRoundingBehavior
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_roundingBehavior, newRoundingBehavior);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setTextAttributesForNegativeValues: (NSDictionary*)newAttributes
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_attributesForNegativeValues, newAttributes);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setTextAttributesForPositiveValues: (NSDictionary*)newAttributes
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
ASSIGN(_attributesForPositiveValues, newAttributes);
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (void) setThousandSeparator: (NSString*)newSeparator
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
if ([newSeparator length] > 0)
|
|
|
|
_thousandSeparator = [newSeparator characterAtIndex: 0];
|
|
|
|
else
|
|
|
|
_thousandSeparator = 0;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2004-06-22 22:40:40 +00:00
|
|
|
//FIXME - not implemented !?
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSString*) stringForObjectValue: (id)anObject
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
if (nil == anObject)
|
|
|
|
return [[self attributedStringForNil] string];
|
2000-09-02 01:44:24 +00:00
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
return [anObject description];
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSDictionary*) textAttributesForNegativeValues
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _attributesForNegativeValues;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSDictionary*) textAttributesForPositiveValues
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
return _attributesForPositiveValues;
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
2001-10-19 09:10:04 +00:00
|
|
|
- (NSString*) thousandSeparator
|
2000-09-02 01:44:24 +00:00
|
|
|
{
|
2001-10-19 09:10:04 +00:00
|
|
|
if (_thousandSeparator == 0)
|
|
|
|
return @"";
|
|
|
|
else
|
|
|
|
return [NSString stringWithCharacters: &_thousandSeparator length: 1];
|
2000-09-02 01:44:24 +00:00
|
|
|
}
|
2001-05-31 22:39:16 +00:00
|
|
|
|
|
|
|
@end
|