private void SetPriceFromLocalizedPrice() { StringBuilder currency = new StringBuilder(); StringBuilder val = new StringBuilder(); foreach (char c in LocalizedPrice.ToCharArray()) { if (isFloatChar(c)) { val.Append(c); } else { currency.Append(c); } } float actualVal; if (float.TryParse(val.ToString(), out actualVal)) { _price = actualVal.ToString(); _PriceCurrencyCode = PriceCurrencyCode.ToString().Trim(); } }
public Product(string name, LocalizedPrice price, LocalizedWeight weight, TagSystem tags, int id) { Tags = new TagSystem(); _name = name; _price = price; _weight = weight; _tags = tags; _id = id; }