uk-inflation

1.0.3 • Public • Published

UK Inflation

Tools for working with inflation-adjusted prices in the UK.

Uses "Composite Price Index" data provided by the Bank of England.

Refer to the Bank of England site for the methods used to adjust prices against inflation and caveats in the calculation data and techniques.

Usage

Require the module the usual way

> var ukinflation = require('ukinflation');

To find out what goods and services costing £23.60 in 1975 would have cost in 1985:

> ukinflation.adjustCost(23.60, 1975, 1985);
65.33768545994066

To get the average inflation between two years:

> ukinflation.averageInflation(1975, 1985)
10.719769831985682

You can also pass in Date objects if it's more convenient:

> var from = new Date('1975');
> var to = new Date('1985');
> ukinflation.adjustCost(23.60, from, to);
65.33768545994066

Note that there's no data for the present year, so you can't convert to "present day" prices;

> ukinflation.adjustCost(23.60, 1975, new Date());
Error: No UK inflation data available for the year 2016

Readme

Keywords

Package Sidebar

Install

npm i uk-inflation

Weekly Downloads

2

Version

1.0.3

License

ISC

Last publish

Collaborators

  • craig552uk