Skip to content

Calculating the percentage of a number or finding the number itself with the percentage included.

Notifications You must be signed in to change notification settings

mahiraltinkaya/percentage-calculation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

This package includes functions that allow you to get percentages of numbers, find a number itself, find the percentage difference between two numbers, and find the percentile of a number.

Installation :

npm install @mahiraltinkaya/percantage-calculation

Usage:

const {
  calculatePercantage,
  claculateMargin,
  getPercentageValue,
  calculateDiff2Values,
} = require("@mahiraltinkaya/percantage-calculation");

console.log(calculatePercantage(100, 18)); // 118
console.log(claculateMargin(118, 18)); // 100
console.log(getPercentageValue(100, 18)); // 18
console.log(calculateDiff2Values(100, 150)); // > 50%
console.log(calculateDiff2Values(150, 100)); // < 50%

Options:

The 3rd parameter of each function is the decimal value. Its Default Value is set to 2. Parameters only accept numeric values.

About

Calculating the percentage of a number or finding the number itself with the percentage included.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published