graphs.py 文件源码

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

项目:anki_progress_stats 作者: matthayes 项目源码 文件源码
def _round_up_max(max_val):
  "Rounds up a maximum value."

  # Prevent zero values raising an error.  Rounds up to 10 at a minimum.
  max_val = max(10, max_val)

  e = int(math.log10(max_val))
  if e >= 2:
    e -= 1
  m = 10**e
  return math.ceil(float(max_val)/m)*m


# Copied from Anki with the following changes:
# - Set tickDecimals to 0.
# - Update tickFormatter to show 1 decimal unless whole number
# TODO pull request to Anki to include these changes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号