C# money类

Money的通用类型(包括您的自定义类型) 一元算术 任意数的二进制算术 涉及相同货币的业务 涉及不同货币的业务

应用介绍

Money的通用类型(包括您的自定义类型)

一元算术

任意数的二进制算术

涉及相同货币的业务

涉及不同货币的业务


Create:
// create money with decimal type of amount in my currency
var localMoney = new Money<decimal>(100m);

// create Australian dollars 
var aud = new Money<decimal>(42m, "AUD"); 
Operate:
var m1 = Money<decimal>(100m, "AUD");
var m2 = Money<decimal>(-42m, "AUD");
var m3 = Money<decimal>(3.1415m, "USD");
var m4 = Money<decimal>(1m, "EUR");
var m5 = Money<decimal>(8m, "GBP");

var audWallet = m1 + m2;
var audWalletValueAsMoney = audWallet.EvaluateWithoutConversion();

var multinationalWallet = (m1 % m5) + ((m2 * 3.5m) / m4) - (m3 * 9m);
var currencyConverter = new MyCurrencyConverter(); // this is some imaginary implementation of ICurrencyConverter<T>
var resultingMoneyInAUD = multinationalWallet.Evaluate(currencyConverter, "AUD");

文件列表(部分)

名称 大小 修改日期
money-master0.00 KB2020-05-08
money-master0.00 KB2020-05-30
Money0.00 KB2016-06-42
CachedCurrencyConverter.cs1.58 KB2016-06-42
Currency.cs3.51 KB2016-06-42
Exceptions0.00 KB2016-06-42
CurrencyMismatchException.cs0.55 KB2016-06-42
IncompatibleAmountTypeException.cs0.52 KB2016-06-42
IncompatibleMoneyTypeException.cs0.52 KB2016-06-42
ICurrencyConverter.cs0.15 KB2016-06-42
Internal0.00 KB2016-06-42
Helpers0.00 KB2016-06-42
BinaryOperationHelper.cs2.46 KB2016-06-42
NumericTypeHelper.cs1.11 KB2016-06-42
UnaryOperationHelper.cs1.36 KB2016-06-42
PassThroughCurrencyConverter.cs0.25 KB2016-06-42
Money.cs1.09 KB2016-06-42
Money.csproj4.69 KB2016-06-42
Money.csproj.DotSettings0.42 KB2016-06-42
Parts0.00 KB2016-06-42
BinaryOperationWithMoney.cs0.75 KB2016-06-42
BinaryOperationWithNumbers.cs3.34 KB2016-06-42
Comparable.cs1.82 KB2016-06-42
Equality.cs1.38 KB2016-06-42
UnaryOperators.cs1.23 KB2016-06-42
Properties0.00 KB2016-06-42
AssemblyInfo.cs1.35 KB2016-06-42
Wallet.cs2.57 KB2016-06-42
WalletComposer0.00 KB2016-06-42
MultiItemWallet.cs1.38 KB2016-06-42
Operation0.00 KB2016-06-42
AdditionOperation.cs0.32 KB2016-06-42

立即下载

相关下载

[C# money类] Money的通用类型(包括您的自定义类型) 一元算术 任意数的二进制算术 涉及相同货币的业务 涉及不同货币的业务

评论列表 共有 0 条评论

暂无评论

微信捐赠

微信扫一扫体验

立即
上传
发表
评论
返回
顶部