Engineering formatting with SI prefixes using Formatting.jl

owiecc
Wed, 23 Aug 2023 11:10:36 +0000
General Usage

I am trying to use pretty formatting engineering with Formatting.jl but I fail. Is it possible to automatically format numbers with SI prefixes and, ideally, be able to select precision?

E.g.:

0.01 → 10m
0.022 → 22m
0.0222 → 22.2m
0.00001 → 10μ

With Formatting.jl and autoscaling I get:

format(0.00001, autoscale = :metric) → 0.01m

Ideally I would prefer this format: [1–1000){SI prefix}{maybe unit}

4 posts - 2 participants