public static jsonTrade FromTrade(Trade _Trade) { jsonTrade tmpTrade = new jsonTrade { is_buy = _Trade.IsBuy, volume = _Trade.Volume.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), price = _Trade.Price.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), timestamp = JSON.ToEpoch(_Trade.Timestamp) }; return(tmpTrade); }
public static Trade ToTrade(jsonTrade _Trade) { Trade tmp = new Trade { IsBuy = _Trade.is_buy, Price = decimal.Parse(_Trade.price, System.Globalization.NumberFormatInfo.InvariantInfo), Volume = decimal.Parse(_Trade.volume, System.Globalization.NumberFormatInfo.InvariantInfo), Timestamp = JSON.FromEpoch(_Trade.timestamp) }; return(tmp); }
public static Trade FromJsonTrade(jsonTrade _Trade) { return(_Trade.ToTrade()); }