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

Dim instance As NumberFormatInfo Dim value As Integer value = instance.NumberNegativePattern instance.NumberNegativePattern = value
/** @property */ public int get_NumberNegativePattern () /** @property */ public void set_NumberNegativePattern (int value)
public function get NumberNegativePattern () : int public function set NumberNegativePattern (value : int)
負の数値の形式パターン。InvariantInfo の既定値は 1 で、"-n" を表します。n は数値です。



さまざまな NumberNegativePattern パターンを使用して値を出力するコードの例を次に示します。
Imports System Imports System.Globalization Imports Microsoft.VisualBasic Class SamplesNumberFormatInfo Public Shared Sub Main() ' Creates a new NumberFormatinfo. Dim myNfi As New NumberFormatInfo() ' Takes a negative value. Dim myInt As Int64 = - 1234 ' Displays the value with default formatting. Console.WriteLine("Default " + ControlChars.Tab + ":" _ + ControlChars.Tab + "{0}", myInt.ToString("N", myNfi)) ' Displays the value with other patterns. Dim i As Integer For i = 0 To 4 myNfi.NumberNegativePattern = i Console.WriteLine("Pattern {0}" + ControlChars.Tab + ":" _ + ControlChars.Tab + "{1}", myNfi.NumberNegativePattern, _ myInt.ToString("N", myNfi)) Next i End Sub End Class ' This code produces the following output. ' ' Default : (1,234.00) ' Pattern 0 : (1,234.00) ' Pattern 1 : -1,234.00 ' Pattern 2 : - 1,234.00 ' Pattern 3 : 1,234.00- ' Pattern 4 : 1,234.00 -
using System; using System.Globalization; class SamplesNumberFormatInfo { public static void Main() { // Creates a new NumberFormatinfo. NumberFormatInfo myNfi = new NumberFormatInfo(); // Takes a negative value. Int64 myInt = -1234; // Displays the value with default formatting. Console.WriteLine( "Default \t:\t{0}", myInt.ToString( "N", myNfi ) ); // Displays the value with other patterns. for ( int i = 0; i <= 4; i++ ) { myNfi.NumberNegativePattern = i; Console.WriteLine( "Pattern {0}\t:\t{1}", myNfi.NumberNegativePattern, myInt.ToString( "N", myNfi ) ); } } } /* This code produces the following output. Default : (1,234.00) Pattern 0 : (1,234.00) Pattern 1 : -1,234.00 Pattern 2 : - 1,234.00 Pattern 3 : 1,234.00- Pattern 4 : 1,234.00 - */
using namespace System; using namespace System::Globalization; int main() { // Creates a new NumberFormatinfo. NumberFormatInfo^ myNfi = gcnew NumberFormatInfo; // Takes a negative value. Int64 myInt = -1234; // Displays the value with default formatting. Console::WriteLine( "Default \t:\t {0}", myInt.ToString( "N", myNfi ) ); // Displays the value with other patterns. for ( int i = 0; i <= 4; i++ ) { myNfi->NumberNegativePattern = i; Console::WriteLine( "Pattern {0}\t:\t {1}", myNfi->NumberNegativePattern, myInt.ToString( "N", myNfi ) ); } } /* This code produces the following output. Default : (1, 234.00) Pattern 0 : (1, 234.00) Pattern 1 : -1, 234.00 Pattern 2 : - 1, 234.00 Pattern 3 : 1, 234.00- Pattern 4 : 1, 234.00 - */
import System.*; import System.Globalization.*; class SamplesNumberFormatInfo { public static void main(String[] args) { // Creates a new NumberFormatinfo. NumberFormatInfo myNfi = new NumberFormatInfo(); // Takes a negative value. Int64 myInt = (Int64)(-1234); // Displays the value with default formatting. Console.WriteLine("Default \t:\t{0}", myInt.ToString("N", myNfi)); // Displays the value with other patterns. for (int i = 0; i <= 4; i++) { myNfi.set_NumberNegativePattern(i); Console.WriteLine("Pattern {0}\t:\t{1}", (Int32)myNfi. get_NumberNegativePattern(), myInt.ToString("N", myNfi)); } } //main } //SamplesNumberFormatInfo /* This code produces the following output. Default : -1,234.00 Pattern 0 : (1,234.00) Pattern 1 : -1,234.00 Pattern 2 : - 1,234.00 Pattern 3 : 1,234.00- Pattern 4 : 1,234.00 - */
import System import System.Globalization // Creates a new NumberFormatinfo. var myNfi : NumberFormatInfo = new NumberFormatInfo() // Takes a negative value. var myInt : Int64 = - 1234 // Displays the value with default formatting. Console.WriteLine("Default \t:\t{0}", myInt.ToString("N", myNfi)) // Displays the value with other patterns. for(var i = 0; i < 5; i++){ myNfi.NumberNegativePattern = i Console.WriteLine("Pattern {0}\t:\t{1}", myNfi.NumberNegativePattern, myInt.ToString("N", myNfi)) } // This code produces the following output. // // Default : (1,234.00) // Pattern 0 : (1,234.00) // Pattern 1 : -1,234.00 // Pattern 2 : - 1,234.00 // Pattern 3 : 1,234.00- // Pattern 4 : 1,234.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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


NumberFormatInfo クラス
NumberFormatInfo メンバ
System.Globalization 名前空間
NumberFormatInfo.NumberDecimalDigits プロパティ
NumberFormatInfo.NumberDecimalSeparator プロパティ
NumberFormatInfo.NumberGroupSeparator プロパティ
NumberFormatInfo.NumberGroupSizes プロパティ
NumberFormatInfo.NaNSymbol プロパティ
NumberFormatInfo.CurrencyNegativePattern プロパティ
PercentNegativePattern
Weblioに収録されているすべての辞書からNumberFormatInfo.NumberNegativePattern プロパティを検索する場合は、下記のリンクをクリックしてください。

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