fieldsye / in-app-purchase-air-ios

Automatically exported from code.google.com/p/in-app-purchase-air-ios
0 stars 0 forks source link

New feature: formatted price localPrice #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The Product class contains price which is a number and priceLocal that is a 
String containing something like it_IT@currency=EUR to state the language used 
by the user in the shop and the type of currency he's using. I found that in 
ObjectiveC the are formatter to transform this two in a more usefull single 
String like 3,99€ to be shown in the shop. This is would be tricky on the AS 
side because we don't have this formatter. It's possible to you to add in the 
Product class a String containing the price and the currency symbol already 
formatted? 

Original issue reported on code.google.com by robertos...@gmail.com on 20 Dec 2011 at 9:40

GoogleCodeExporter commented 9 years ago
This is the ObjectiveC code I found googling but I can't test it :(

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[numberFormatter setLocale:product.priceLocale];
NSString *stringPrice = [numberFormatter stringFromNumber:product.price];
[numberFormatter release];

Original comment by robertos...@gmail.com on 20 Dec 2011 at 9:54

GoogleCodeExporter commented 9 years ago
Use flash.globalization.CurrencyFormatter in Flash.

Original comment by neverbi...@gmail.com on 20 Dec 2011 at 1:39