
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Decimal.FromOACurrency() Method in C#
The Decimal.FromOACurrency() method in C# is used to convert the specified 64-bit signed integer, which contains an OLE Automation Currency value, to the equivalent Decimal value
Syntax
Following is the syntax −
public static decimal FromOACurrency (long val);
Above, Val is an OLE Automation Currency value.
Example
Let us now see an example to implement the Decimal.FromOACurrency() method −
using System; public class Demo { public static void Main(){ long val = 978576L; decimal res = Decimal.FromOACurrency(val); Console.WriteLine("Decimal Value = "+ res); } }
Output
This will produce the following output −
Decimal Value = 97.8576
Example
Let us now see another example to implement the Decimal.FromOACurrency() method −
using System; public class Demo { public static void Main(){ long val = long.MinValue; decimal res = Decimal.FromOACurrency(val); Console.WriteLine("Decimal Value = "+ res); } }
Output
This will produce the following output −
Decimal Value = -922337203685477.5808
Advertisements