Exemplo n.º 1
0
        /// <summary>
        /// 1~9の数値をアホ変換します。
        /// </summary>
        /// <param name="value">元の数値</param>
        /// <param name="number">変換対象の数値</param>
        /// <param name="digit">何桁目か</param>
        /// <returns></returns>
        public string ToFoolNumber(BigInteger value, int number, int digit)
        {
            var result = "";

            if (digit == 1)
            {
                // 1の位
                return(ConvertFoolNumber(value, number, digit));
            }
            else
            {
                // 単位の区切りを取得
                var digitPart = Consts.GetDigitPart(digit);

                switch (number)
                {
                case 0: return("");

                case 1:
                    return(digitPart switch
                    {
                        Consts.DigitPartType.One => _IsSokuon(digit) ? "いっ" : "いち",
                        _ => "",
                    });
Exemplo n.º 2
0
 public void GetDigitPart(int digit, Consts.DigitPartType expected)
 {
     Assert.Equal(expected, Consts.GetDigitPart(digit));
 }