当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - UILabel with attributed number formatted text inserts `-character

问题描述:

I'm using a UILabel with a currency which I got through

 NSNumberFormatter *numberFormatter = [NSNumberFormatter new];

[[NSThread currentThread] threadDictionary][numberFormatterKey] = numberFormatter;

[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];

numberFormatter.currencyCode = @"EUR";

My resulting string looks good, e.g. -4.098,83 € when I log it. But my label displays -4.098,83`€- so there's an additional character before the currency. Why is this and how can I avoid it?

分享给朋友:
您可能感兴趣的文章:
随机阅读: