NumberFormatInfo.CurrencyGroupSizes プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As NumberFormatInfo Dim value As Integer() value = instance.CurrencyGroupSizes instance.CurrencyGroupSizes = value
public: property array<int>^ CurrencyGroupSizes { array<int>^ get (); void set (array<int>^ value); }
/** @property */ public int[] get_CurrencyGroupSizes () /** @property */ public void set_CurrencyGroupSizes (int[] value)
public function get CurrencyGroupSizes () : int[] public function set CurrencyGroupSizes (value : int[])
通貨の値で小数点の左にある各グループの数字の数。InvariantInfo の既定値は 1 つだけの要素を持つ 1 次元配列であり、その要素は 3 に設定されます。


1 次元配列のすべての要素は、1 ~ 9 の間の整数にする必要があります。最後の要素は 0 にできます。
配列の最初の要素は、CurrencyDecimalSeparator のすぐ左にある、最も桁の小さい数字のグループの要素数を定義します。後続の各要素は、前のグループの左にある、次に桁の大きい数字のグループを参照します。配列の最後の要素が 0 ではない場合、残りの数字は配列の最後の要素に基づいてグループ化されます。最後の要素が 0 の場合、残りの数字はグループ化されません。
たとえば、配列が { 3, 4, 5 } を格納している場合、その数字は "$55,55555,55555,55555,4444,333.00" のようにグループ化されます。配列が { 3, 4, 0 } を格納している場合、その数字は "$55555555555555555,4444,333.00" のようにグループ化されます。

CurrencyGroupSizes プロパティの変更による影響を次のコード例に示します。
Imports System Imports System.Globalization Class NumberFormatInfoSample Public Shared Sub Main() ' Gets a NumberFormatInfo associated with the en-US culture. Dim nfi As NumberFormatInfo = New CultureInfo("en-US", False).NumberFormat ' Displays a value with the default separator ("."). Dim myInt As Int64 = 123456789012345 Console.WriteLine(myInt.ToString("C", nfi)) ' Displays the same value with different groupings. Dim mySizes1 As Integer() = {2, 3, 4} Dim mySizes2 As Integer() = {2, 3, 0} nfi.CurrencyGroupSizes = mySizes1 Console.WriteLine(myInt.ToString("C", nfi)) nfi.CurrencyGroupSizes = mySizes2 Console.WriteLine(myInt.ToString("C", nfi)) End Sub 'Main End Class 'NumberFormatInfoSample 'This code produces the following output. ' '$123,456,789,012,345.00 '$12,3456,7890,123,45.00 '$1234567890,123,45.00
using System; using System.Globalization; class NumberFormatInfoSample { public static void Main() { // Gets a NumberFormatInfo associated with the en-US culture. NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat; // Displays a value with the default separator ("."). Int64 myInt = 123456789012345; Console.WriteLine( myInt.ToString( "C", nfi ) ); // Displays the same value with different groupings. int[] mySizes1 = {2,3,4}; int[] mySizes2 = {2,3,0}; nfi.CurrencyGroupSizes = mySizes1; Console.WriteLine( myInt.ToString( "C", nfi ) ); nfi.CurrencyGroupSizes = mySizes2; Console.WriteLine( myInt.ToString( "C", nfi ) ); } } /* This code produces the following output. $123,456,789,012,345.00 $12,3456,7890,123,45.00 $1234567890,123,45.00 */
using namespace System; using namespace System::Globalization; int main() { // Gets a NumberFormatInfo associated with the en-US culture. CultureInfo^ MyCI = gcnew CultureInfo( "en-US",false ); NumberFormatInfo^ nfi = MyCI->NumberFormat; // Displays a value with the default separator (S"."). Int64 myInt = 123456789012345; Console::WriteLine( myInt.ToString( "C", nfi ) ); // Displays the same value with different groupings. array<Int32>^mySizes1 = {2,3,4}; array<Int32>^mySizes2 = {2,3,0}; nfi->CurrencyGroupSizes = mySizes1; Console::WriteLine( myInt.ToString( "C", nfi ) ); nfi->CurrencyGroupSizes = mySizes2; Console::WriteLine( myInt.ToString( "C", nfi ) ); } /* This code produces the following output. $123, 456, 789, 012, 345.00 $12, 3456, 7890, 123, 45.00 $1234567890, 123, 45.00 */
import System.*; import System.Globalization.*; class NumberFormatInfoSample { public static void main(String[] args) { // Gets a NumberFormatInfo associated with the en-US culture. NumberFormatInfo nfi = (new CultureInfo("en-US", false)).get_NumberFormat(); // Displays a value with the default separator ("."). Int64 myInt = (Int64)123456789012345L; Console.WriteLine(myInt.ToString("C", nfi)); // Displays the same value with different groupings. int mySizes1[] = { 2, 3, 4 }; int mySizes2[] = { 2, 3, 0 }; nfi.set_CurrencyGroupSizes(mySizes1); Console.WriteLine(myInt.ToString("C", nfi)); nfi.set_CurrencyGroupSizes(mySizes2); Console.WriteLine(myInt.ToString("C", nfi)); } //main } //NumberFormatInfoSample /* This code produces the following output. $123,456,789,012,345.00 $12,3456,7890,123,45.00 $1234567890,123,45.00 */

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からNumberFormatInfo.CurrencyGroupSizes プロパティを検索する場合は、下記のリンクをクリックしてください。

- NumberFormatInfo.CurrencyGroupSizes プロパティのページへのリンク