UNPKG

@lomray/microservice-payment-stripe

Version:

Stripe payment microservice based on NodeJS & inverted json.

14 lines (11 loc) 272 B
'use strict'; /** * Returns unit percent from amount */ const getPercentFromAmount = (amountUnit, percent) => { if (!percent || percent > 100) { return 0; } return Math.round(amountUnit * (percent / 100)); }; module.exports = getPercentFromAmount;