mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-10 18:17:31 +08:00
Merge b96534794d into 50e0e3c70c
This commit is contained in:
commit
1a319eb967
@ -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)))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user