Re: NSNumberFormatter strange symbols on PPC/10.4
Re: NSNumberFormatter strange symbols on PPC/10.4
- Subject: Re: NSNumberFormatter strange symbols on PPC/10.4
- From: Stéphane BARON <email@hidden>
- Date: Tue, 9 Dec 2008 19:55:35 +0100
I did encounter the same problem (developing on 10.5 and testing on
10.4)
It seem's to be a know bug in NSNumberFormatter
I solved it by subclassing NSNumberFormatter like this:
#import "MCNumberFormatter.h"
@implementation MCNumberFormatter
- (NSString *)stringForObjectValue:(id)anObject
{
////NSLog(@"stringforobject anobject: %@ ",anObject);
if([anObject isEqualTo:[NSDecimalNumber zero]])
return @"";
else
return [super stringForObjectValue:anObject];
}
- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string
errorDescription:(NSString **)error
{
////NSLog(@"getObjectValueforString: %@ aString",string);
return [super getObjectValue:anObject forString:string
errorDescription:error];
}
@end
and used this class like this:
MCNumberFormatter *totalFormatter = [[MCNumberFormatter alloc] init];
[totalFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[totalFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[totalFormatter setLocalizesFormat:YES];
[totalFormatter setMinimumFractionDigits:2];
[totalFormatter setMaximumFractionDigits:2];
Hopes it help
Stéphane
Le 8 déc. 08 à 20:53, Andy Bettis a écrit :
Hi,
In my app I have an NSTableView in the main window, within this
there's a column with an NSNumberFormatter attached. The formatter
is set to 10.4 behaviour and currency style. On my development
machine all looks OK, however the customer's machine shows the
numbers as a currency symbol (£, I'm in the UK) then a series of
symbols replacing the numbers. Most numbers show as a white, rounded
cornered square with a sort of T character inside, zeroes show as a
black, rounded cornered square with a crossed zero inside, some
others show as a double apostrophe in the white square. Decimal
points show OK.
When printed the numbers are replaced with punctuation characters,
not the symbols shown on the screen.
I'm developing on an Intel Mac Mini running 10.5.5. I've tried a few
older machines which all show the weird characters, they are mostly
running 10.4.11 and using PPC processors so I don't know if this is
a PPC or Tiger problem.
I have a few projects lined up that will probably run on Tiger
systems so I'd like to know if this is easily fixable or whether I
need to write my own cash formatting routine.
Ta.
Andy_______________________________________________
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
_______________________________________________
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