C# Decimal FromOACurrency
Description
Decimal FromOACurrency
converts the specified 64-bit
signed integer, which contains an OLE Automation Currency value, to the
equivalent Decimal value.
Syntax
Decimal.FromOACurrency
has the following syntax.
public static decimal FromOACurrency(
long cy
)
Parameters
Decimal.FromOACurrency
has the following parameters.
cy
- An OLE Automation Currency value.
Returns
Decimal.FromOACurrency
method returns A Decimal that contains the equivalent of cy.
Example
The following code example uses the FromOACurrency method to convert Int64 fields that contain OLE Automation Currency values to the equivalent Decimal numbers.
using System;/* w w w .j a v a 2 s. com*/
class MainClass
{
public static void Main( )
{
decimal decCurrency = decimal.FromOACurrency( 1000000000000000000L );
Console.WriteLine( decCurrency );
}
}
The code above generates the following result.