5.1.0 • Published 3 years ago

calculatorreadjustment v5.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

readjustment-calculation


function that calculates the rent readjustmente for a given value and date

Installation:


You can install using npm with the following command:

Preparing:


You'll have to import the function:

  • import { Calculation } from "calculatorreadjustment/calculation.js";

Using:


Now you're able to call Calculation in your code, the argument is an object containing:

  • index (IGPM or IPCA)
  • baseDate (the date from the start of the calculation)
  • baseValue (the rent that use to be charged on the baseDate)

It returns an object containing the last readjusted value according to the arguments and a calculation memory by year

Examples


(async (calculation) => {
    try {

        const resultIGPM = await calculation({
            index: 'IGPM',
            baseDate: '2019-11-01',
            baseValue: '300.33',
        })
        
        console.log(resultIGPM) // { value: 363.17, memory: []

        const resultIPCA = await calculation({
            index: 'IPCA',
            baseDate: '2015-12-01',
            baseValue: 300.33,
        })
        console.log(resultIPCA) // { value: 370.25, memory: [] }

    } catch (error) {
        console.error(error) // new Error();
    }
})(Calculation)

dependencies:

  • axios

5.1.0

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.1.11

3 years ago

4.1.12

3 years ago

4.1.3

3 years ago

4.1.6

3 years ago

4.1.0

3 years ago

4.2.1

3 years ago

4.1.2

3 years ago

4.2.0

3 years ago

4.1.1

3 years ago

4.0.0

4 years ago

3.8.0

4 years ago

3.7.0

4 years ago

3.6.0

4 years ago

3.5.0

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.1

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago