Reading the documentation, I would have to do something ugly like this:
NSLocale *usLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:@"0.00001" locale:usLocale];
But: Isn't there a nicer way of telling that NSDecimalNumber class to look out for the period (.) instead of anything else? Locales feel so unsafe to me. What if one day a new president thinks to be so cool to change the period symbol from . to ,? Then my app crashes. Sure this won't happen so likely. But there is a little chance it could. Enough to scare me using a locale for this ;-)
Any idea? Or is that my only option? And if it is the only option: Is the above approach correct? Or is there even a better one?
And: If I get that right, the NSDecimalNumber object will read that string, parse it and create the mantissa, exponent and isNegative values out of it for internal use, right?
EDIT: I should have mentioned that I add those values programmatically / manually (in my code), they're not user input.