博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C#NumberFormatInfo类
阅读量:4544 次
发布时间:2019-06-08

本文共 986 字,大约阅读时间需要 3 分钟。

1 class Program 2     { 3         static void Main(string[] args) 4         { 5             //retrieve current culture info by cloning it so that 6             //we can manipulate its NumberFormat member 7             CultureInfo ci = Thread.CurrentThread.CurrentCulture.Clone() as CultureInfo; 8             NumberFormatInfo nfi = ci.NumberFormat; 9 10             //set "123456" to "123|456*"11             nfi.CurrencyPositivePattern = 1;12             nfi.CurrencyGroupSeparator = "|";13             nfi.CurrencySymbol = "*";14             nfi.CurrencyDecimalDigits = 0;15             //reset the NumberFormat16             ci.NumberFormat = nfi;17             //set the thread culture to our modified CultureInfo18             Thread.CurrentThread.CurrentCulture = ci;19             Console.WriteLine(123456.ToString("C"));20             //"C" indicate use Currency format21         }22     }

 

 and the interval :every three digits.

 

 

转载于:https://www.cnblogs.com/jecyhw/p/3473950.html

你可能感兴趣的文章
Java 多线程编程
查看>>
ArcGIS Engine的安装
查看>>
shell入门基础必备
查看>>
在VS2010下运行Qt程序
查看>>
80x86的硬件基础知识摘要
查看>>
algorithm
查看>>
python实例一
查看>>
python小实例——tkinter实战(计算器)
查看>>
素数筛法
查看>>
不等式恒成立求字母范围
查看>>
队列、环形队列(用数组实现)
查看>>
Educational Codeforces Round 37 (Rated for Div. 2) ABC
查看>>
本来想偷懒的今天,想了想,还是写一篇吧,前端登录界面,用的BOOTSTRAP
查看>>
cordova 安装使用
查看>>
*.app 无法打开或已损坏解决办法
查看>>
kali linux之手动漏洞挖掘一
查看>>
php笔记一
查看>>
nginx 配置
查看>>
SpringBoot使用JPA来做数据查询
查看>>
linux下如何修改mysql默认配置文件的位置
查看>>