Decimal.FromOACurrency(Int64) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
OLE Automation Currency 값을 포함하는 지정된 64비트 부속 정수를 해당하는 Decimal 값으로 변환합니다.
public:
static System::Decimal FromOACurrency(long cy);
public static decimal FromOACurrency(long cy);
static member FromOACurrency : int64 -> decimal
Public Shared Function FromOACurrency (cy As Long) As Decimal
매개 변수
- cy
- Int64
OLE 자동화 통화 값입니다.
반품
해당하는 Decimal을 포함하는 A cy 입니다.
예제
다음 코드 예제에서는 이 메서드를 사용하여 FromOACurrency OLE Automation Currency 값이 포함된 필드를 해당하는 Int64 숫자로 변환 Decimal 합니다.
// Example of the decimal.FromOACurrency method.
using System;
class DecimalFromOACurrencyDemo
{
const string dataFmt = "{0,21}{1,25}";
// Display the decimal.FromOACurrency parameter and decimal result.
public static void ShowDecimalFromOACurrency( long Argument )
{
decimal decCurrency = decimal.FromOACurrency( Argument );
Console.WriteLine( dataFmt, Argument, decCurrency );
}
public static void Main( )
{
Console.WriteLine( "This example of the " +
"decimal.FromOACurrency( ) method generates \nthe " +
"following output. It displays the OLE Automation " +
"Currency \nvalue as a long and the result as a " +
"decimal.\n" );
Console.WriteLine( dataFmt, "OA Currency", "Decimal Value" );
Console.WriteLine( dataFmt, "-----------", "-------------" );
// Convert OLE Automation Currency values to decimal objects.
ShowDecimalFromOACurrency( 0L );
ShowDecimalFromOACurrency( 1L );
ShowDecimalFromOACurrency( 100000L );
ShowDecimalFromOACurrency( 100000000000L );
ShowDecimalFromOACurrency( 1000000000000000000L );
ShowDecimalFromOACurrency( 1000000000000000001L );
ShowDecimalFromOACurrency( long.MaxValue );
ShowDecimalFromOACurrency( long.MinValue );
ShowDecimalFromOACurrency( 123456789L );
ShowDecimalFromOACurrency( 1234567890000L );
ShowDecimalFromOACurrency( 1234567890987654321 );
ShowDecimalFromOACurrency( 4294967295L );
}
}
/*
This example of the decimal.FromOACurrency( ) method generates
the following output. It displays the OLE Automation Currency
value as a long and the result as a decimal.
OA Currency Decimal Value
----------- -------------
0 0
1 0.0001
100000 10
100000000000 10000000
1000000000000000000 100000000000000
1000000000000000001 100000000000000.0001
9223372036854775807 922337203685477.5807
-9223372036854775808 -922337203685477.5808
123456789 12345.6789
1234567890000 123456789
1234567890987654321 123456789098765.4321
4294967295 429496.7295
*/
// Example of the Decimal.FromOACurrency method.
open System
let dataFmt obj1 obj2 = printfn $"{obj1,21}{obj2,25}"
// Display the Decimal.FromOACurrency parameter and decimal result.
let showDecimalFromOACurrency argument =
let decCurrency = Decimal.FromOACurrency argument
dataFmt argument decCurrency
printfn
"""This example of the Decimal.FromOACurrency() method generates
the following output. It displays the OLE Automation Currency
value as a long and the result as a decimal.
"""
dataFmt "OA Currency" "Decimal Value"
dataFmt "-----------" "-------------"
// Convert OLE Automation Currency values to decimal objects.
showDecimalFromOACurrency 0L
showDecimalFromOACurrency 1L
showDecimalFromOACurrency 100000L
showDecimalFromOACurrency 100000000000L
showDecimalFromOACurrency 1000000000000000000L
showDecimalFromOACurrency 1000000000000000001L
showDecimalFromOACurrency Int64.MaxValue
showDecimalFromOACurrency Int64.MinValue
showDecimalFromOACurrency 123456789L
showDecimalFromOACurrency 1234567890000L
showDecimalFromOACurrency 1234567890987654321L
showDecimalFromOACurrency 4294967295L
// This example of the Decimal.FromOACurrency() method generates
// the following output. It displays the OLE Automation Currency
// value as a long and the result as a decimal.
// OA Currency Decimal Value
// ----------- -------------
// 0 0
// 1 0.0001
// 100000 10
// 100000000000 10000000
// 1000000000000000000 100000000000000
// 1000000000000000001 100000000000000.0001
// 9223372036854775807 922337203685477.5807
// -9223372036854775808 -922337203685477.5808
// 123456789 12345.6789
// 1234567890000 123456789
// 1234567890987654321 123456789098765.4321
// 4294967295 429496.7295
' Example of the Decimal.FromOACurrency method.
Module DecimalFromOACurrencyDemo
Const dataFmt As String = "{0,21}{1,25}"
' Display the Decimal.FromOACurrency parameter and Decimal result.
Sub ShowDecimalFromOACurrency( Argument As Long )
Dim decCurrency As Decimal = _
Decimal.FromOACurrency( Argument )
Console.WriteLine( dataFmt, Argument, decCurrency )
End Sub
Sub Main( )
Console.WriteLine( "This example of the " & _
"Decimal.FromOACurrency( ) method generates " & vbCrLf & _
"the following output. It displays the OLE Automation " & _
"Currency " & vbCrLf & "value as a Long and the " & _
"result as a Decimal." & vbCrLf )
Console.WriteLine( dataFmt, "OA Currency", "Decimal Value" )
Console.WriteLine( dataFmt, "-----------", "-------------" )
' Convert OLE Automation Currency values to Decimal objects.
ShowDecimalFromOACurrency( 0L )
ShowDecimalFromOACurrency( 1L )
ShowDecimalFromOACurrency( 100000L )
ShowDecimalFromOACurrency( 100000000000L )
ShowDecimalFromOACurrency( 1000000000000000000L )
ShowDecimalFromOACurrency( 1000000000000000001L )
ShowDecimalFromOACurrency( Long.MaxValue )
ShowDecimalFromOACurrency( Long.MinValue )
ShowDecimalFromOACurrency( 123456789L )
ShowDecimalFromOACurrency( 1234567890000L )
ShowDecimalFromOACurrency( 1234567890987654321 )
ShowDecimalFromOACurrency( 4294967295L )
End Sub
End Module
' This example of the Decimal.FromOACurrency( ) method generates
' the following output. It displays the OLE Automation Currency
' value as a Long and the result as a Decimal.
'
' OA Currency Decimal Value
' ----------- -------------
' 0 0
' 1 0.0001
' 100000 10
' 100000000000 10000000
' 1000000000000000000 100000000000000
' 1000000000000000001 100000000000000.0001
' 9223372036854775807 922337203685477.5807
' -9223372036854775808 -922337203685477.5808
' 123456789 12345.6789
' 1234567890000 123456789
' 1234567890987654321 123456789098765.4321
' 4294967295 429496.7295