using System;
namespace SK.Framework
{
public static class IntExtension
{
///
/// 转化为字母 (1-26表示字母A-Z)
///
/// int值
/// 字母值
public static char ToLetter(this int self)
{
if (self < 1 || self > 26) return default;
return Convert.ToChar('A' + self - 1);
}
///
/// 阶乘
///
/// int值
/// 阶乘结果
public static int Fact(this int self)
{
if (self == 0)
{
return 1;
}
else
{
return self * Fact(self - 1);
}
}
}
}