Medium syndication metadata

This commit is contained in:
Brandon Rozek 2023-03-10 12:41:04 -05:00
parent c5b2488589
commit 9bf7cfb744
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
14 changed files with 82 additions and 64 deletions

View file

@ -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]
```
```