Currencygroupsizes Property
This property gets or sets the number of digits in each group to the left of the decimal points in the currency value.
The syntax format is:
public int[] CurrencyGroupSizes{get;set;}
L Property Value: The number of digits in each group to the left of the decimal points in the currency value. The default value is a one-dimensional array that contains only one element that is set to 3.
The main code is as follows.
private void button1_Click(objectsender,EventArgs e)
{
System.Globalization.NumberFormatInfo CN=new System.Globalization.CultureInfo("en-US",false).NumberFormat;
Int64 myInt=123456789012345;
int[] mySizes1={2,3,1};
int[] mySizes2={2,3,2};
CN.CurrencyGroupSizes=mySizes1;
MessageBox.Show("定义前:"+myInt.ToString("C")+"n"+"定义后:"+myInt.ToString("C",CN),"{2,3,1}格式");
CN.CurrencyGroupSizes=mySizes2;
MessageBox.Show("定义前:"+myInt.ToString("C")+"n"+"定义后:"+myInt.ToString("C",CN),"{2,3,2}格式");
}