iphone - IS there any easier way to show $ currency format?(As specially commas) Can I integrate RE with Objective C code? -
I am using X code 4.
And make a US currency calculator.
My aim is to display the numbers in the proper format?
Like
$ 1,234
$ 12,100
$ 1,23,123
I add it and string stuff Do not want to.
Is there any easy way to integrate any RE or any Ruby or Python which will help me in forming a currency format.
Please show me the easy way instead of long programming.
allows you to format the currency taken from the example
// Build FormatsNsNumberFormatter * formatter = [[NSNumberFormatter alloc] init]; // -------------------------------------------- // format style In the form of currency, the output for the console ----------------------------------------- - - [Setter Settlement Style: NSNumberFormatterCurrencyStyle]; NSString * Formatted Output = [Formatting StringformNumber: [NSNumber NumberAttah: 1234]]; NSLog (@ "output as currency:% @", formatted output); // -------------------------------------------- // Change local And output as currency -------------------------------------------- NSLocale * locale = [[NSLocale alloc] initWithLocaleIdentifier: @ "it_IT"]; [Setter sitelokel: locale]; Formatted Output = [Formatting StringformNumber: [NSNumber Numbers: 1234]]; NSLog (@ "output as currency - locale it_IT:% @", formatted output); [Locale release]; [Format release];
Comments
Post a Comment