numeric.py 文件源码

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

项目:extrade 作者: aza7 项目源码 文件源码
def normalized(d, where=None, place=8):
    amo_pla = (Decimal("10") ** -place)
    if where == 'C': where = ROUND_CEILING
    if where == 'DOWN': where = ROUND_DOWN
    if where == 'F': where = ROUND_FLOOR
    if where == 'HD': where = ROUND_HALF_DOWN
    if where == 'HE': where = ROUND_HALF_EVEN
    if where == 'HP': where = ROUND_HALF_UP
    if where == 'UP': where = ROUND_UP
    if where == '0UP': where = ROUND_05UP
    return (Decimal(d).quantize(amo_pla, rounding=where or ROUND_UP)).normalize()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号