592 数字转中文海外版本直接返回数字,繁体的万显示成萬
| | |
| | | //不需要提取翻译的文本 |
| | | 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]; |
| | | |
| | |
| | | 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 |
| | |
| | | case 43: |
| | | case 44: |
| | | return GetUIColor(TextColType.itemshenhua, bright); |
| | | |
| | | |
| | | |
| | | |
| | | } |