mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 10:55:57 +08:00
1 parent
50e0e3c70c
commit
b96534794d
1 file changed
+6
@@ -37,6 +37,12 @@ def human_format(num):
|
||||
Args:
|
||||
num: number to format
|
||||
"""
|
||||
# Prevents math domain error
|
||||
if num == 0:
|
||||
return "0.00"
|
||||
if num < 0:
|
||||
return f"-{human_format(-num)}"
|
||||
|
||||
units = ["", "K", "M", "B", "T", "P"]
|
||||
k = 1000.0
|
||||
magnitude = int(floor(log(num, k)))
|
||||
|
||||
Reference in new issue
Block a user