Code Explainers

Code explainers tagged #units

typescript
export interface FormatBytesOptions {
  decimals?: number;
  binary?: boolean;
}

Formatting byte counts into human-readable sizes

formatting logarithms default-parameters
Intermediate 8 steps
go
package humanize
 
import (
	"fmt"

Parsing human-readable byte sizes in Go

parsing regex lookup-table
Intermediate 8 steps