Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use "System.Currency" in .NET?

Tags:

.net

Is it possible to use system.currency. It says system.currency is inaccessible due to its protection level. what is the alternative of currency.

like image 888
jbcedge Avatar asked Sep 30 '08 00:09

jbcedge


2 Answers

You have to use Decimal data type..

The decimal keyword indicates a 128-bit data type. Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations.

like image 175
Gulzar Nazim Avatar answered Oct 21 '22 11:10

Gulzar Nazim


Use Decimal. All of the functions that Currency provides are static methods on Decimal, FromOACurrency, and ToOACurrency.

like image 8
MagicKat Avatar answered Oct 21 '22 10:10

MagicKat