C#将数字转各个国家币种格式源码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

将币种输出成各个国家的币种格式,如:

2654.2563654:
zh-CN 保留1位小数 ¥2,654.3
en-US 保留1位小数 $2,654.3
aa-ET 保留1位小数 Br2,654.3
ve-ZA 保留1位小数 R2,654,3
ug-CN 保留1位小数 ¥2,654.3
tr-TR 保留1位小数 ₺2,654,3
th-TH 保留1位小数 ฿2,654.3
da-DK 保留1位小数 2,654,3 kr.
br-FR 保留1位小数 2,654,3 €
ar-SA 保留1位小数 2,654.3 ر.س.‏
zh-CN 保留2位小数 ¥2,654.26
en-US 保留2位小数 $2,654.26
aa-ET 保留2位小数 Br2,654.26
ve-ZA 保留2位小数 R2,654,26
ug-CN 保留2位小数 ¥2,654.26
tr-TR 保留2位小数 ₺2,654,26
th-TH 保留2位小数 ฿2,654.26
da-DK 保留2位小数 2,654,26 kr.
br-FR 保留2位小数 2,654,26 €
ar-SA 保留2位小数 2,654.26 ر.س.‏
zh-CN 保留3位小数 ¥2,654.256
en-US 保留3位小数 $2,654.256
aa-ET 保留3位小数 Br2,654.256
ve-ZA 保留3位小数 R2,654,256
ug-CN 保留3位小数 ¥2,654.256
tr-TR 保留3位小数 ₺2,654,256
th-TH 保留3位小数 ฿2,654.256
da-DK 保留3位小数 2,654,256 kr.
br-FR 保留3位小数 2,654,256 €
ar-SA 保留3位小数 2,654.256 ر.س.‏
zh-CN 保留4位小数 ¥2,654.2564
en-US 保留4位小数 $2,654.2564
aa-ET 保留4位小数 Br2,654.2564
ve-ZA 保留4位小数 R2,654,2564
ug-CN 保留4位小数 ¥2,654.2564
tr-TR 保留4位小数 ₺2,654,2564
th-TH 保留4位小数 ฿2,654.2564
da-DK 保留4位小数 2,654,2564 kr.
br-FR 保留4位小数 2,654,2564 €
ar-SA 保留4位小数 2,654.2564 ر.س.‏

实现代码如下:

        private void zbtnsubmit_Click(object sender, EventArgs e)
        {
            zlog.AppendText(zprice.Value.ToString() + ":" + Environment.NewLine);
            for (int i = 1; i < 5; i++)
            {
                System.Globalization.NumberFormatInfo GN = new System.Globalization.CultureInfo("zh-CN", false).NumberFormat;
                GN.CurrencyDecimalDigits = i;
                zlog.AppendText("zh-CN 保留" + i + "位小数 " + zprice.Value.ToString("C", GN) + Environment.NewLine);
                string[] str = new string[] { "en-US", "aa-ET", "ve-ZA", "ug-CN", "tr-TR", "th-TH", "da-DK", "br-FR", "ar-SA" };
                foreach (string stren in str)
                {
                    System.Globalization.NumberFormatInfo US = new System.Globalization.CultureInfo(stren, false).NumberFormat;
                    US.CurrencyGroupSeparator = ",";
                    US.CurrencyDecimalDigits = i;
                    zlog.AppendText(stren + " 保留" + i + "位小数 " + zprice.Value.ToString("C", US) + Environment.NewLine);
                }
            }
            zlog.AppendText(Environment.NewLine);
        }

各个国家代码如下:

// The example displays the following output on a Windows system.  This output has been cropped for brevity.
//    CULTURE                                              SPECIFIC CULTURE
//                 Invariant Language (Invariant Country)
//    aa           Afar                                    aa-ET
//    af           Afrikaans                               af-ZA
//    agq          Aghem                                   agq-CM
//    ak           Akan                                    ak-GH
//    am           Amharic                                 am-ET
//    ar           Arabic                                  ar-SA
//    arn          Mapudungun                              arn-CL
//    as           Assamese                                as-IN
//    asa          Asu                                     asa-TZ
//    ast          Asturian                                ast-ES
//    az           Azerbaijani                             az-Latn-AZ
//    az-Cyrl      Azerbaijani (Cyrillic)                  az-Cyrl-AZ
//    az-Latn      Azerbaijani (Latin)                     az-Latn-AZ
//    ba           Bashkir                                 ba-RU
//    bas          Basaa                                   bas-CM
//    be           Belarusian                              be-BY
//    bem          Bemba                                   bem-ZM
//    bez          Bena                                    bez-TZ
//    bg           Bulgarian                               bg-BG
//    bin          Edo                                     bin-NG
//    bm           Bamanankan                              bm-Latn-ML
//    bm-Latn      Bamanankan (Latin)                      bm-Latn-ML
//    bn           Bangla                                  bn-BD
//    bo           Tibetan                                 bo-CN
//    br           Breton                                  br-FR
//    brx          Bodo                                    brx-IN
//    bs           Bosnian                                 bs-Latn-BA
//    bs-Cyrl      Bosnian (Cyrillic)                      bs-Cyrl-BA
//    bs-Latn      Bosnian (Latin)                         bs-Latn-BA
//    byn          Blin                                    byn-ER
//    ca           Catalan                                 ca-ES
//    ce           Chechen                                 ce-RU
//    cgg          Chiga                                   cgg-UG
//    chr          Cherokee                                chr-Cher-US
//    chr-Cher     Cherokee                                chr-Cher-US
//    co           Corsican                                co-FR
//    cs           Czech                                   cs-CZ
//    cu           Church Slavic                           cu-RU
//    cy           Welsh                                   cy-GB
//    da           Danish                                  da-DK
//    dav          Taita                                   dav-KE
//    de           German                                  de-DE
//    dje          Zarma                                   dje-NE
//    dsb          Lower Sorbian                           dsb-DE
//    dua          Duala                                   dua-CM
//    dv           Divehi                                  dv-MV
//    ...
//    ta           Tamil                                   ta-IN
//    te           Telugu                                  te-IN
//    teo          Teso                                    teo-UG
//    tg           Tajik                                   tg-Cyrl-TJ
//    tg-Cyrl      Tajik (Cyrillic)                        tg-Cyrl-TJ
//    th           Thai                                    th-TH
//    ti           Tigrinya                                ti-ER
//    tig          Tigre                                   tig-ER
//    tk           Turkmen                                 tk-TM
//    tn           Setswana                                tn-ZA
//    to           Tongan                                  to-TO
//    tr           Turkish                                 tr-TR
//    ts           Tsonga                                  ts-ZA
//    tt           Tatar                                   tt-RU
//    twq          Tasawaq                                 twq-NE
//    tzm          Central Atlas Tamazight                 tzm-Latn-DZ
//    tzm-Arab     Central Atlas Tamazight (Arabic)        tzm-Arab-MA
//    tzm-Latn     Central Atlas Tamazight (Latin)         tzm-Latn-DZ
//    tzm-Tfng     Central Atlas Tamazight (Tifinagh)      tzm-Tfng-MA
//    ug           Uyghur                                  ug-CN
//    uk           Ukrainian                               uk-UA
//    ur           Urdu                                    ur-PK
//    uz           Uzbek                                   uz-Latn-UZ
//    uz-Arab      Uzbek (Perso-Arabic)                    uz-Arab-AF
//    uz-Cyrl      Uzbek (Cyrillic)                        uz-Cyrl-UZ
//    uz-Latn      Uzbek (Latin)                           uz-Latn-UZ
//    vai          Vai                                     vai-Vaii-LR
//    vai-Latn     Vai (Latin)                             vai-Latn-LR
//    vai-Vaii     Vai (Vai)                               vai-Vaii-LR
//    ve           Venda                                   ve-ZA
//    vi           Vietnamese                              vi-VN
//    vo           Volapük                                 vo-001
//    vun          Vunjo                                   vun-TZ
//    wae          Walser                                  wae-CH
//    wal          Wolaytta                                wal-ET
//    wo           Wolof                                   wo-SN
//    xh           isiXhosa                                xh-ZA
//    xog          Soga                                    xog-UG
//    yav          Yangben                                 yav-CM
//    yi           Yiddish                                 yi-001
//    yo           Yoruba                                  yo-NG
//    zgh          Standard Moroccan Tamazight             zgh-Tfng-MA
//    zgh-Tfng     Standard Moroccan Tamazight (Tifinagh)  zgh-Tfng-MA
//    zh           Chinese                                 zh-CN
//    zh-CHS       Chinese (Simplified) Legacy             zh-CN
//    zh-CHT       Chinese (Traditional) Legacy            zh-HK
//    zh-Hans      Chinese (Simplified)                    zh-CN
//    zh-Hant      Chinese (Traditional)                   zh-HK
//    zu           isiZulu                                 zu-ZA
// The example displays output like the following on a Unix-based system. The output has been cropped for brevity.
//    CULTURE                                              SPECIFIC CULTURE
//                 Invariant Language (Invariant Country)
//    af           Afrikaans                               af-ZA
//    agq          Aghem                                   agq-CM
//    ak           Akan                                    ak-GH
//    am           Amharic                                 am-ET
//    ar           Arabic                                  ar-SA
//    as           Assamese                                as-IN
//    asa          Asu                                     asa-TZ
//    ast          Asturian                                ast-ES
//    az           Azerbaijani                             az-Latn-AZ
//    az-Cyrl      Azerbaijani                             az-Cyrl-AZ
//    az-Latn      Azerbaijani                             az-Latn-AZ
//    bas          Basaa                                   bas-CM
//    be           Belarusian                              be-BY
//    bem          Bemba                                   bem-ZM
//    bez          Bena                                    bez-TZ
//    bg           Bulgarian                               bg-BG
//    bm           Bambara                                 bm-Latn-ML
//    bn           Bangla                                  bn-BD
//    bo           Tibetan                                 bo-CN
//    br           Breton                                  br-FR
//    brx          Bodo                                    brx-IN
//    bs           Bosnian                                 bs-Latn-BA
//    bs-Cyrl      Bosnian                                 bs-Cyrl-BA
//    bs-Latn      Bosnian                                 bs-Latn-BA
//    ca           Catalan                                 ca-ES
//    ccp          Chakma
//    ce           Chechen                                 ce-RU
//    cgg          Chiga                                   cgg-UG
//    chr          Cherokee                                chr-Cher-US
//    ckb          Central Kurdish
//    cs           Czech                                   cs-CZ
//    cy           Welsh                                   cy-GB
//    da           Danish                                  da-DK
//    dav          Taita                                   dav-KE
//    de           German                                  de-DE
//    dje          Zarma                                   dje-NE
//    dsb          Lower Sorbian                           dsb-DE
//    dua          Duala                                   dua-CM
//    ...
//    ta           Tamil                                   ta-IN
//    te           Telugu                                  te-IN
//    teo          Teso                                    teo-UG
//    tg           Tajik                                   tg-Cyrl-TJ
//    th           Thai                                    th-TH
//    ti           Tigrinya                                ti-ER
//    to           Tongan                                  to-TO
//    tr           Turkish                                 tr-TR
//    tt           Tatar                                   tt-RU
//    twq          Tasawaq                                 twq-NE
//    tzm          Central Atlas Tamazight                 tzm-Latn-DZ
//    ug           Uyghur                                  ug-CN
//    uk           Ukrainian                               uk-UA
//    ur           Urdu                                    ur-PK
//    uz           Uzbek                                   uz-Latn-UZ
//    uz-Arab      Uzbek                                   uz-Arab-AF
//    uz-Cyrl      Uzbek                                   uz-Cyrl-UZ
//    uz-Latn      Uzbek                                   uz-Latn-UZ
//    vai          Vai                                     vai-Vaii-LR
//    vai-Latn     Vai                                     vai-Latn-LR
//    vai-Vaii     Vai                                     vai-Vaii-LR
//    vi           Vietnamese                              vi-VN
//    vun          Vunjo                                   vun-TZ
//    wae          Walser                                  wae-CH
//    wo           Wolof                                   wo-SN
//    xog          Soga                                    xog-UG
//    yav          Yangben                                 yav-CM
//    yi           Yiddish                                 yi-001
//    yo           Yoruba                                  yo-NG
//    yue          Cantonese                               yue-HK
//    yue-Hans     Cantonese
//    yue-Hant     Cantonese
//    zgh          Standard Moroccan Tamazight             zgh-Tfng-MA
//    zh           Chinese                                 zh-CN
//    zh-Hans      Chinese                                 zh-CN
//    zh-Hant      Chinese                                 zh-HK
//    zu           Zulu                                    zu-ZA

实现效果如下:


附件:下载该文件资源,减少时间成本(增值服务)
不商用,只限学习使用,使用后请删除
上传者拥有该资源完整版权,下载既表明已授权您可以进行报备商用,无报备或者使用后报备,视为侵权,报备后使用,为合法有效使用,报备方式,下载后,在下载列表,点击报备,填写使用场景即可
文件部分展示图(单击放大)
C#将数字转各个国家币种格式源码C#将数字转各个国家币种格式源码
留言
该资源可下载
File Source
.rar
207.67 KB
C#将数字转各个国家币种格式源码C#将数字转各个国家币种格式源码
最新结算
股权转让协议意向书模板
类型: .docx 金额: CNY 2.23¥ 状态: 待结算 详细>
股权转让协议意向书模板
类型: .docx 金额: CNY 0.28¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 2.39¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 0.3¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章