mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
Changed humanize_megabytes
This commit is contained in:
parent
a1fd983173
commit
fab2a612ac
@ -111,13 +111,13 @@ def humanize_megabytes(mb):
|
||||
bytes = int(mb * 1024**2)
|
||||
|
||||
if bytes >= factors["tera"]:
|
||||
return f"{bytes / factors["tera"]:.2f} TB"
|
||||
return f"{bytes / factors['tera']:.2f} TB"
|
||||
|
||||
if bytes >= factors["giga"]:
|
||||
return f"{bytes / factors["giga"]:.2f} GB"
|
||||
return f"{bytes / factors['giga']:.2f} GB"
|
||||
|
||||
if bytes >= factors["mega"]:
|
||||
return f"{bytes / factors["mega"]:.2f} MB"
|
||||
return f"{bytes / factors['mega']:.2f} MB"
|
||||
|
||||
|
||||
@register.filter()
|
||||
|
Loading…
Reference in New Issue
Block a user