encoder.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Vector-Tiles-Reader-QGIS-Plugin 作者: geometalab 项目源码 文件源码
def _round(self, val):
        # Prefer provided round function.
        if self.round_fn:
            return self.round_fn(val)

        # round() has different behavior in python 2/3
        # For consistency between 2 and 3 we use quantize, however
        # it is slower than the built in round function.
        d = decimal.Decimal(val)
        rounded = d.quantize(1, rounding=decimal.ROUND_HALF_EVEN)
        return float(rounded)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号