C# Decimal ToOACurrency

Description

Decimal ToOACurrency converts the specified Decimal value to the equivalent OLE Automation Currency value, which is contained in a 64-bit signed integer.

Syntax

Decimal.ToOACurrency has the following syntax.


public static long ToOACurrency(
  decimal value
)

Parameters

Decimal.ToOACurrency has the following parameters.

  • value - The decimal number to convert.

Returns

Decimal.ToOACurrency method returns A 64-bit signed integer that contains the OLE Automation equivalent of value.

Example

The following code example uses the ToOACurrency method to convert Decimal numbers to the equivalent OLE Automation Currency values that are contained in Int64 fields.


using System;/*from ww w  .  j  a v  a  2  s  .com*/

class DecimalToOACurrencyDemo
{
    public static void Main( )
    {
        long oaCurrency = decimal.ToOACurrency( 1.0000000000000000000000000000M );
        Console.WriteLine( oaCurrency );

    }
}

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