2014年3月12日水曜日

C#で9DSRの計算

/// 
/// 9DSR 計算
/// NW-7
/// 
/// /// 
public static string Get9DSR(string Value)
{
    bool result = Regex.IsMatch(Value, @"^[0-9]+$");
    if (!result)
    {
        return null;
    }
    return (ulong.Parse(Value) % 9 == 0 ? 0 : 9 - (int.Parse(Value) % 9)).ToString();
}

0 件のコメント:

コメントを投稿