UNPKG

492 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports["default"] = void 0;
7var _default = {
8 getPosition: function getPosition(value, min, max) {
9 return (value - min) / (max - min) * 100;
10 },
11 getValue: function getValue(pos, min, max) {
12 var decimal = pos / 100;
13
14 if (pos === 0) {
15 return min;
16 }
17
18 if (pos === 100) {
19 return max;
20 }
21
22 return Math.round((max - min) * decimal + min);
23 }
24};
25exports["default"] = _default;
\No newline at end of file