Strings.FormatCurrency(Object, Int32, TriState, TriState, TriState) Yöntem
Tanım
Sistem denetim masasında tanımlanan para birimi simgesini kullanarak para birimi değeri olarak biçimlendirilen bir ifade döndürür.Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.
public static string FormatCurrency (object? Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault);
public static string FormatCurrency (object Expression, int NumDigitsAfterDecimal = -1, Microsoft.VisualBasic.TriState IncludeLeadingDigit = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers = Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState GroupDigits = Microsoft.VisualBasic.TriState.UseDefault);
static member FormatCurrency : obj * int * Microsoft.VisualBasic.TriState * Microsoft.VisualBasic.TriState * Microsoft.VisualBasic.TriState -> string
Public Function FormatCurrency (Expression As Object, Optional NumDigitsAfterDecimal As Integer = -1, Optional IncludeLeadingDigit As TriState = Microsoft.VisualBasic.TriState.UseDefault, Optional UseParensForNegativeNumbers As TriState = Microsoft.VisualBasic.TriState.UseDefault, Optional GroupDigits As TriState = Microsoft.VisualBasic.TriState.UseDefault) As String
Parametreler
- Expression
- Object
Gereklidir.Required. Biçimlendirilecek ifade.Expression to be formatted.
- NumDigitsAfterDecimal
- Int32
İsteğe bağlı.Optional. Ondalık değeri, Decimal 'ın sağında kaç basamak gösterileceğini belirtir.Numeric value indicating how many places are displayed to the right of the decimal. Varsayılan değer-1 ' dir, bu da bilgisayarın bölgesel ayarlarının kullanıldığını gösterir.Default value is -1, which indicates that the computer's regional settings are used.
- IncludeLeadingDigit
- TriState
İsteğe bağlı.Optional. TriState kesirli değerler için önünde sıfır gösterilip gösterilmeyeceğini belirten sabit listesi.TriState enumeration that indicates whether or not a leading zero is displayed for fractional values. Değerler için "açıklamalar" başlığına bakın.See "Remarks" for values.
- UseParensForNegativeNumbers
- TriState
İsteğe bağlı.Optional. TriState negatif değerlerin parantez içine yerleştirip yerleştirmeyeceğini belirten sabit listesi.TriState enumeration that indicates whether or not to place negative values within parentheses. Değerler için "açıklamalar" başlığına bakın.See "Remarks" for values.
- GroupDigits
- TriState
İsteğe bağlı.Optional. TriState sayıların, bilgisayarın bölgesel ayarlarında belirtilen grup sınırlayıcısı kullanılarak gruplanıp gruplandırmadığını belirten sabit listesi.TriState enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. Değerler için "açıklamalar" başlığına bakın.See "Remarks" for values.
Döndürülenler
Sistem denetim masasında tanımlanan para birimi simgesini kullanarak para birimi değeri olarak biçimlendirilen bir ifade.An expression formatted as a currency value using the currency symbol defined in the system control panel.
Özel durumlar
Ondalık ayırıcıdan sonraki basamak sayısı 99 ' den büyük.Number of digits after decimal point is greater than 99.
Tür sayısal değil.Type is not numeric.
Örnekler
Aşağıdaki örnek, işlevinin kullanımını gösterir FormatCurrency .The following example illustrates the use of the FormatCurrency function.
Dim testDebt As Double = -4456.43
Dim testString As String
' Returns "($4,456.43)".
testString = FormatCurrency(testDebt, , , TriState.True, TriState.True)
Açıklamalar
Bir veya daha fazla isteğe bağlı bağımsız değişken atlandığında, bunun yerine bilgisayarın eşleşen bölge ayarları değerleri kullanılır.When one or more optional arguments are omitted, the computer's matching regional-settings values are used instead.
Para birimi değerine göre para birimi sembolünün konumu, sistemin bölgesel ayarları tarafından belirlenir.The position of the currency symbol relative to the currency value is determined by the system's regional settings.
Not
Tüm ayar bilgileri, uygulamanın yerel ayarından gelir.All settings information comes from the locale of the application. Varsayılan olarak, Denetim Masası 'nda yerel ayar olarak ayarlanır.By default, that will be the locale set in the control panel. Ancak, sekmesinden gelen öndeki sıfır dışında .NET Framework kullanılarak programlı bir şekilde değiştirilebilir Number .However, it may be changed programmatically by using the .NET Framework, except leading zero, which comes from the Number tab.
IncludeLeadingDigit, UseParensForNegativeNumbers Ve GroupDigits bağımsız değişkenleri aşağıdaki TriState numaralandırma değerlerini alır.The IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits arguments take the following TriState enumeration values.
| DeğerValue | AçıklamaDescription |
|---|---|
TriState.True |
DoğruTrue |
TriState.False |
YanlışFalse |
TriState.UseDefault |
Bilgisayarın bölgesel ayarlarıThe computer's regional settings |