UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

12 lines (11 loc) 312 B
import { clamp as p } from "../../../utils/value/number.js"; function f(c, e, r, o) { if (e >= r) return 0; const t = o > 0 ? o : 1; if (t > r - e) return 0; const u = (Math.round((c - e) / t) * t + e - e) * 100 / (r - e); return Number(p(0, u, 100).toFixed(2)); } export { f as calculateProgress };