Пример #1
0
        /// <summary>
        /// Shifts the decimal point. <para>If negative, shift left; otherwise, shift right.</para>
        /// </summary>
        /// <param name="value"></param>
        /// <param name="shifts"></param>
        /// <returns></returns>
        public static Double Shift(this Double value, Int32 shifts = 1)
        {
            var LeftOrRight = shifts < 0;

            for (var i = 0; i < shifts.Absolute(); i++)
            {
                value = LeftOrRight ? value / 10 : value * 10;
            }

            return(value);
        }