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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version