mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
1 parent
50e0e3c70c
commit
b96534794d
1 file changed
+6
@@ -37,6 +37,12 @@ def human_format(num):
|
|||||||
Args:
|
Args:
|
||||||
num: number to format
|
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"]
|
units = ["", "K", "M", "B", "T", "P"]
|
||||||
k = 1000.0
|
k = 1000.0
|
||||||
magnitude = int(floor(log(num, k)))
|
magnitude = int(floor(log(num, k)))
|
||||||
|
|||||||
Reference in new issue
Block a user