public Averages AssignValues()
write it, you can return Structs in the same way as classes, but remember that the fields in the structures are initialized with default values, so your struct definition should be:
public struct Averages { public decimal Sell_GoldOunce; public decimal Buy_GoldOunce; public decimal Sell_SilverOunce; public decimal Buy_SilverOunce; public int Sell_Mazene; public int Buy_Mazene; public int Sell_Gram_18; public int Buy_Gram_18; public int Sell_Gram_24; public int Buy_Gram_24; };
Therefore, when you write Avereges a = new Avereges()
→ a.Buy_Gram_24
, it will be 0, because the value of ints int is by default.
source share