Esempio n. 1
0
        public static SplitTick ToSplitTick(string[] row)
        {
            var tick = new SplitTick {
                DateTime = row[0].ToDateTime()
            };

            var split = row[1].Split('/');

            if (split.Length == 2)
            {
                tick.AfterSplit  = split[0].ToDecimal();
                tick.BeforeSplit = split[1].ToDecimal();
            }

            if (IgnoreEmptyRows && tick.AfterSplit == 0 && tick.BeforeSplit == 0)
            {
                return(null);
            }

            return(tick);
        }
Esempio n. 2
0
        internal static SplitTick?ToSplitTick(string[] row)
        {
            var tick = new SplitTick {
                DateTime = row[0].ToDateTime()
            };

            // var split = row[1].Split('/');   // original source code fails
            var split = row[1].Split(':');  // 2020-06-09 fix. It looks like "1:8" instead of "1/8"

            if (split.Length == 2)
            {
                tick.AfterSplit  = split[0].ToDecimal();
                tick.BeforeSplit = split[1].ToDecimal();
            }

            if (IgnoreEmptyRows && tick.AfterSplit == 0 && tick.BeforeSplit == 0)
            {
                return(null);
            }

            return(tick);
        }