shamikbose89 commited on
Commit
e5cf85f
·
1 Parent(s): 2fe7b61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,11 +19,11 @@ def int_to_string(size: int, precision=2):
19
  power = math.ceil(math.log(size))
20
  size_human_readable = ""
21
  if power > 12:
22
- size_human_readable = "%.2f Trillion"%size/(10**12)
23
  elif power > 9:
24
- size_human_readable = "%.2f Billion"%size/(10**9)
25
  elif power > 6:
26
- size_human_readable = "%.2f Million"%size/(10**6)
27
  else:
28
  size_human_readable = str(size)
29
  return size_human_readable
 
19
  power = math.ceil(math.log(size))
20
  size_human_readable = ""
21
  if power > 12:
22
+ size_human_readable = f"{(size/10**12):.2 Trillion}"
23
  elif power > 9:
24
+ size_human_readable = f"{(size/10**9):.2 Billion}"
25
  elif power > 6:
26
+ size_human_readable = f"{(size/10**6):.2 Million}"
27
  else:
28
  size_human_readable = str(size)
29
  return size_human_readable