示例#1
0
    static string?ConvertTrio(int val, int group, bool?femenine)
    {
        string trio = val.ToString("000");

        int cent = CharUtil.ToInt(trio[0]);
        int dec  = CharUtil.ToInt(trio[1]);
        int unit = CharUtil.ToInt(trio[2]);

        if (cent == 0 && dec == 0 && unit == 0 && group % 2 == 1)
        {
            return(null);
        }

        string?groupName = UnitsGroup(group, unit != 1 || dec > 0 || cent > 0);

        string num = CentsDecsUnits(cent, dec, unit, group >= 2 ? null : femenine);

        return(" ".Combine(val == 1 && groupName == "mil" ? null : num, groupName));
    }