How can I get a price of a consumable product from c# code? I need this as a double, but the StorePrice
object seems to only offer FormattedPrice
as a string (e.g. "42,00 $"):
var storeProducts = await this.storeContext.GetStoreProductsAsync(new[] { "UnmanagedConsumable" }, new[] { "xyz" });
var iap = storeProducts.Products["xyz"];
var price = iap.Price;
price.FormattedPrice ...
I need to get the price as double so I can calculate how much cheaper one IAP is compared to the other.
It looks like I will have to parse the amount out of the formatted string, but that just feels stupid. Are there any other options?