createAmountIn

createAmountIn(T)(T t, double amount): template function returns Amount

createAmountIn
(
T
)
(
T t
,
double amount
)

Examples

auto GBP = new Currency("GBP", "Great British Pound", 2);
auto amount = createAmountIn!Currency(GBP, 1000);
auto ts = cast(DateTime) amount.timestamp;

assert(is(typeof(GBP) == Currency));
assert(is(typeof(amount) == Amount));

createMoneyIn (T)(T t)

template function returns currency
alias GBP = currency!("GBP");
// auto a = createAmountIn!Currency(GBP, 1000);
// auto money = createMoneyIn!Amount(a);
// assert(is(typeof(money) == currency));
// assert(is(typeof(a) == Amount));
// assert(is(typeof(GBP) == currency));

Meta