lcy
4 天以前 0fa42f76f382cf3361e09c0beb0be34eb2073ddf
Main/Utility/UIHelper.cs
@@ -23,10 +23,16 @@
    //不需要提取翻译的文本
    private static readonly string[] numbers = new string[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" };
    private static readonly string[] units = new string[] { "十", "百", "千", "万" };
    private static readonly string[] unitFTs = new string[] { "十", "百", "千", "萬" };
    //数字转中文(只做小数字),海外版本调用改函数切换版本请直接返回数字
    public static string ChineseNumber(int number)
    {
        string langId = Language.Id;
        if (!string.IsNullOrEmpty(langId) && langId != "zh" && langId != "ft")
            return number.ToString();
        string[] curUnits = (langId == "ft") ? unitFTs : units;
        if (number == 0)
            return numbers[0];
@@ -42,7 +48,7 @@
                if (needZero)
                    result = StringUtility.Concat(numbers[0] + result);
                result = numbers[part] + (unitPlace == 1 ? "" : units[unitPlace - 2]) + result; // 单位只在十、百、千、万内部使用
                result = numbers[part] + (unitPlace == 1 ? "" : curUnits[unitPlace - 2]) + result; // 单位只在十、百、千、万内部使用
                needZero = false;
            }
            else
@@ -567,7 +573,7 @@
            case 43:
            case 44:
                return GetUIColor(TextColType.itemshenhua, bright);
        }