def parse_percentage(percentage):
if percentage is None:
return AdvancedBoxScoreDeserializerUtils.default_decimal_value
if not isinstance(percentage, float):
raise ValueError("Expected a float instead of %s", percentage)
return Decimal((100 * Decimal(percentage)).quantize(Decimal(".1"), rounding=ROUND_HALF_UP))
advanced_box_score_deserializer_utils.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录