tags:

views:

37

answers:

3

Hi All,

Having an issue with an app I have done that has been approved and is on the app store.

The problem is I have a section that adds some float values together then uses, NSnumberformatter to convert them to currency.

On the iphone simulator and if uploaded to the phone (in debug or release) it works fine and adds up the correct price

When you download the app from the store it goes crazy and instead of adding the correct amount you end up with a figure of

$80,000,000,000,000,000,000,000,000,000,000,000,000,000.00

And no, I'm not exaggerating the number of zeros. I can only see this figure in the console window of organizer, on the phone it shows as a negative number.

My problem is given it won't do it to me in any form of the test environment its a little hard to debug.

Is the problem likely to be in the use of floats with conversion(it converts strings to floats and then back again, due to how they are read in and how they are display)

Or is it more likely the currency formatter is going wild, would I be better off using a straight decimal formatter and then manually adding a $ to the display.

Could there be an issue with it not figuring out the correct currency or something?

Thanks in advance Michaek

A: 

When testing did you try a clean install? (Delete app, run clean, then build and run..)

I don't see why it would work on device testing but not downloaded from the app store.. Did you try deleting the app and reinstalling from the app store?

Larsaronen
Yup, and lots of other people have the same issue.
A: 

Silly question, but are you still running the exact same codebase that you used to build the app you submitted to the store?

Is it possible you've re-factored/updated SDK/replaced libs since submission and this has introduced a bug 'fix' that wasn't spotted at time of submission?

davbryn
A: 

Or is it more likely the currency formatter is going wild, would I be better off using a straight decimal formatter and then manually adding a $ to the display.

I have no idea wether the currency formatter is going wild, but NSNumberFormatter supports NSDecimalNumbers. So you can actually use NSDecimalNumbers for the calculations, pass in the final calculated decimal number into the NSNumberFormatter and get a properly formatted string result back.

klaaspieter
I'm going to give that one a go, only problem is to test if it really works I'm basically going to have to reupload to the store, wait the 5-10 days and hope :(
No matter if it works or not, you might want to file a [radar](http://bugreporter.apple.com) for this. It's really strange that your app behaves differently when submitted to the store.
klaaspieter