Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
add in-app purchase localized price — Gideros Forum

add in-app purchase localized price

krisiskrisis Member
edited June 2013 in Suggestions & requests
I noticed that the StoreKit.mm simply returns:
lua_pushnumber(L, [product.price doubleValue]);
lua_setfield(L, -2, "price");
However, it is recommended to return a localized price string. Can I suggest providing this as an additional field in the StoreKit plug-in? The code for it is:
NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init] autorelease];
[formatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setLocale:product.priceLocale];
NSString *currencyString = [formatter stringFromNumber:product.price];
[ Twitter: pushpoke | Facebook: facebook.com/pushpoke | Web: pushpoke.com | Letter Stack iOS: letterstack.com ]

Comments

  • Totally agree!
    I used this code snippet in my local storekit.mm, I hop it would be better to included in the offical release.
    NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
    			//[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
    			[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    			[numberFormatter setLocale:product.priceLocale];
    			NSString *currencyString = [numberFormatter stringFromNumber:product.price];
    			lua_pushstring(L, [currencyString UTF8String]);
    			lua_setfield(L, -2, "currencyString");
Sign In or Register to comment.