Show money in today's value
Choose Today's value in the results' money value selector to express monetary outputs in the purchasing power of the model's first timeline date. Nominal is the default. The selector appears when the model's effective inflation is nonzero. Changing it starts a new calculation with the selected money value setting and updates Run input; the base calculation and scenarios use the same selection.
Model authors declare the annual inflation assumption once with defineModel({inflation}). Use a number such as 0.02 for 2%, or reuse an existing numeric input reference. The input can live in any group, tab or page; its position does not control conversion. Omission defaults to zero.
Reuse an inflation input
Enter this model in the model editor:
const inflation = deccf.input.rate(0.02, {ui: {label: "Annual inflation"}});
const assumptions = deccf.input.group({inflation});
const owner = deccf.entity.party();
const income = deccf.cashflow({
owner,
direction: deccf.inflow,
schedule: deccf.schedule.annual(),
amount: 10200,
});
const model = deccf.defineModel({
currency: deccf.currencies.SEK,
timeline: deccf.periods.annual({from: "2026-01", count: 2}),
preconditions: {assumptions},
inflation,
entities: {owner},
flows: {income},
});
const result = deccf.run(model, {moneyValue: "today"});
// result.flow(income) is [10200, 10000].
// result.moneyValueBaseDate is "2026-01-01".
return model;moneyValue accepts "nominal" or "today"; omission selects "nominal". With today's value selected, an amount on a future date is divided by (1 + inflation) ** elapsedYears. Whole calendar anniversaries count as full years; partial years use actual days between anniversaries. At 2% inflation, 10,200 SEK one year later is 10,000 SEK at the base date. A February 29 anniversary falls on February 28 in a year without February 29.
The base date is the first resolved timeline date, including any start-date input override. It is recorded with the effective annual rate in result.moneyValueBaseDate and result.inflation; result.moneyValue records the chosen mode. These fields are also included in serialized results.
Date future money inside a record
A projection may publish future annual amounts during a single model period. Give each Money value its own valuation date so conversion uses the date of the amount:
const forecast = deccf.calculation({
name: "forecast",
publish: true,
resultType: {futureIncome: "money", age: "number", growth: "number", label: "text"},
calculate: () => ({
futureIncome: deccf.money(10200, deccf.currencies.SEK, {date: "2027-01-01"}),
age: 65,
growth: 0.03,
label: "First retirement year",
}),
});
const model = deccf.defineModel({
currency: deccf.currencies.SEK,
timeline: deccf.periods.annual({from: "2026-01", count: 1}),
inflation: 0.02,
calculations: {forecast},
});
const result = deccf.run(model, {moneyValue: "today"});
// result.calculation(forecast)[0].futureIncome.amount is 10000.
// age is 65, growth is 0.03 and label keeps its text.
return model;money(amount, currency, {date}) returns Money with its nominal amount, currency and optional valuation date. Use a valid YYYY-MM-DD calendar date; an ISO year-month is also accepted and normalized to its first day. The explicit date takes priority over the series point's date. An undated custom money metric uses its last evaluated metric window's date. An undated money series or record leaf uses its actual output point's date. A text field named date elsewhere in a record does not date its Money fields.
scaleMoney() and convertMoney() preserve a valuation date. addMoney() and subtractMoney() preserve it when both operands have the same date; otherwise the result is undated. Explicitly date the resulting Money when combining amounts needs a chosen valuation date.
Monetary outputs and financial assumptions
Cashflows, accounts, options, monetary summaries and typed Money leaves in structured calculations are converted. Plain numeric calculations and fields, rates, ages, counts and text keep their values. Declare monetary calculation outputs with a Money result type and return deccf.money(...); a numeric value does not become monetary because its name suggests money.
model.total sums converted cashflows. Annual sum rollups aggregate converted points. model.npv is already a present value at the base date and keeps its value. Inflation conversion changes output purchasing power; the discount rate continues to control NPV. Input values, account state and calculation callbacks retain their nominal values.
If nominal costs or income should grow with inflation, explicitly use the input in those calculations, for example baseCost * (1 + ctx.get(inflation)) ** elapsedYears. The model's inflation declaration alone does not increase costs, income, contributions or balances.
runMonteCarlo() supports the same moneyValue setting and computes monetary means, percentiles and histograms from converted trial results. runScenarios() applies the shared setting to every scenario; each resolves its own inflation override and timeline start. A distribution used as the inflation input supplies its central value, matching ordinary input reads; it is not automatically sampled for output conversion.
Validation
Inflation must be finite and greater than -1. Negative inflation is valid; zero leaves monetary amounts identical in both modes. An inflation input must be a declared scalar numeric input; curves, Money inputs and derived references are unsupported. Its effective override is also validated. Invalid money value modes and invalid valuation dates are rejected. Money amounts must be finite and use a Currency reference.
For all run options, see Run configuration. See Result format for the published fields and Discount cashflows for valuation assumptions.