using System;

namespace JiShe.CollectBus.Common.Extensions
{
    public static class IntExtensions
    {
        /// <summary>
        /// 十进制转二进制
        /// </summary>
        /// <param name="decimalNumber">十进制数</param>
        /// <returns></returns>
        public static string DecToBin(this int decimalNumber)
        {
            var binaryString = Convert.ToString(decimalNumber, 2);
            return binaryString;
        }


        /// <summary>
        /// 十进制转十六进制
        /// </summary>
        /// <param name="decimalNumber"></param>
        /// <returns></returns>
        public static string DecToHex(this int decimalNumber)
        {
            var hexString = decimalNumber.ToString("X");
            return hexString;
        }
    }
}
