iphone - How to you calculate currency values, if the "cents" portion doesn't show up? -


I'm feeling painful to Noab and want to lose. Let's just say that I want to add 1,302.22 and ".22" part, it does not appear, I add "44.55" to the next currency and fifty five percent will not show me how to give me a headache with ".00" Can i fix the thing


  double currency = [volume 1. Text double value] + [zodiac 2. Text double value]; NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [NumberFormatter Settlement Style: NSNumberFormatterCurrencyStyle]; NSString * numberAsString = [numberFormatter stringFromNumber: [NSNumber numberWind: currency]]; Currency.text = [NSString stringWithFormat: @ "% @", numberoststring];    

I doubt there is a problem here:

  NSString * numberAsString = [numberFormatter stringFromNumber: [NSNumber numberWind: currency]];   

[With NSNM number number: currency] creates an NSNumber object, with an integer value. The integer value you are passing is currency However, the type of currency is a double.

An easy way to think about a double is to think about a decimal, an easy way to think about a integer Think about the number that is not the decimal point. You can convert the concept by adding the decimal point, or by removing it between two.

Since you are going through a system repeatedly, which you consider to be integers and integers, you are punching.

Example: Double 1035.55 becomes 1035 when you change it to an integer

Try to change numberwithith by double digits and see if you have a better fortune.

Also do not give up, we are all there: D

Comments