mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-10-09 14:31:13 +00:00
Medium syndication metadata
This commit is contained in:
parent
c5b2488589
commit
9bf7cfb744
14 changed files with 82 additions and 64 deletions
|
@ -1,10 +1,11 @@
|
|||
---
|
||||
title: "Human Readable Sizes"
|
||||
date: 2021-03-15T19:11:35-04:00
|
||||
date: 2021-03-15 23:11:35
|
||||
draft: false
|
||||
tags: []
|
||||
math: true
|
||||
medium_enabled: true
|
||||
medium_post_id: 2a32b08bd2c1
|
||||
tags: []
|
||||
title: Human Readable Sizes
|
||||
---
|
||||
|
||||
When playing with large and small values, it is useful to convert them to a different unit in scientific notation. Let's look at bytes.
|
||||
|
@ -45,5 +46,4 @@ def humanReadableBytes(num_bytes: int) -> str:
|
|||
|
||||
return "{:.2f} ".format(num_bytes / (base ** category_num)) + \
|
||||
size_categories[category_num]
|
||||
```
|
||||
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue