import * as tslib_1 from "tslib";
import { Injectable } from '@angular/core';
var SliderService = /** @class */ (function () {
    function SliderService() {
    }
    /**
     * 根据position计算slider-hand当前的value
     * @param pos trackerPos
     */
    SliderService.prototype.getValue = function (pos, step, min, max) {
        var value = Math.round((max - min) * pos / 100 + min);
        var remainder = value % step;
        var round = Math.floor(value / step);
        // 四舍五入
        if (remainder < 5) {
            value = step * round;
        }
        else {
            value = step * (round + 1);
        }
        return value;
    };
    SliderService = tslib_1.__decorate([
        Injectable()
    ], SliderService);
    return SliderService;
}());
export { SliderService };
//# sourceMappingURL=slider.service.js.map