Skip to content

Simple pricing utils to reduce code replication & calculation errors

License

Notifications You must be signed in to change notification settings

fabiofcferreira/pricing-utils

Repository files navigation

pricing-utils

pricing-utils is a simple pricing utils to reduce code replication & calculation errors

Install

yarn add pricing-utils

Usage

import { roundPrice, calculateNetPrice, calculateGrossPrice } from './pricing-utils';

const roundedPrice = roundPrice(19.984, 2); // 19.98
const roundedPrice = calculateGrossPrice(16.25, 23); // 16.25 + 23% VAT = 19.99
const roundedPrice = calculateNetPrice(19.99, 23); // 19.99 - 23% VAT = 16.25

About

Simple pricing utils to reduce code replication & calculation errors

Resources

License

Stars

Watchers

Forks

Packages

No packages published