|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
NumberFormatInfo.CurrencyDecimalSeparator, propriété
.NET Framework 4.5
Espace de noms : System.Globalization
Assembly : mscorlib (dans mscorlib.dll)
Valeur de propriété
Type : System.String| Exception | Condition |
|---|---|
| ArgumentNullException | |
| InvalidOperationException | |
| ArgumentException |
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 = 123456789; Console.WriteLine( myInt.ToString( "C", nfi ) ); // Displays the same value with a blank as the separator. nfi.CurrencyDecimalSeparator = " "; Console.WriteLine( myInt.ToString( "C", nfi ) ); } } /* This code produces the following output. $123,456,789.00 $123,456,789 00 */
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.