1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports["default"] = void 0;
|
7 | var _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 | };
|
25 | exports["default"] = _default; |
\ | No newline at end of file |