add jt.Var,__format__

This commit is contained in:
li-xl 2020-12-01 19:46:43 +08:00
parent 7f0444d0e0
commit 294af2f525
1 changed files with 5 additions and 0 deletions

View File

@ -884,6 +884,11 @@ Var.__int__ = to_int
Var.__float__ = to_float
Var.__bool__ = to_bool
def format(v, spec):
return v.item().__format__(spec)
Var.__format__ = format
int = int32
Var.int = Var.int32
float = float32