Exemplo n.º 1
0
        public static long IsLong(this FObject obj)
        {
            var res = obj.Is(ObjType.Number);

            if (res is int i)
            {
                return(i);
            }
            if (res is long l)
            {
                return(l);
            }
            else if (res is double f)
            {
                return((long)f);
            }
            throw new Exception($"{res} is not a number");
        }