From deb04e31fd58dbb5ac7037d4710e94449c957670 Mon Sep 17 00:00:00 2001 From: Alex Gardner Date: Thu, 1 May 2025 09:07:41 -0700 Subject: [PATCH 1/4] add uparse example in index --- docs/src/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/src/index.md b/docs/src/index.md index 7a9e7bc4..708841fa 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -102,6 +102,18 @@ julia> mod(1hr+3minute+5s, 24s) 17 s ``` +You can also parse units from a string +```jldoctest +julia> unit_str = "km/m^2" +"kg/m^2" + +julia> units = uparse(unit_str) +kg m⁻² + +julia> 100 * units +100 kg m⁻² +``` + One useful interactive function is being able to convert to preferred (in this case SI) units. ```jldoctest From 52af1c3931ee635f442bbc9689db019ff40cc6a7 Mon Sep 17 00:00:00 2001 From: Alex Gardner <32276930+alex-s-gardner@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:38:34 -0700 Subject: [PATCH 2/4] Update docs/src/index.md this was my mistake Co-authored-by: Isaac Wheeler <47340776+Ickaser@users.noreply.github.com> --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index 708841fa..f74d8639 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -104,7 +104,7 @@ julia> mod(1hr+3minute+5s, 24s) You can also parse units from a string ```jldoctest -julia> unit_str = "km/m^2" +julia> unit_str = "kg/m^2" "kg/m^2" julia> units = uparse(unit_str) From 5c4e027efff753b5238090dda6f88a4d572484ff Mon Sep 17 00:00:00 2001 From: Alex Gardner <32276930+alex-s-gardner@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:38:45 -0700 Subject: [PATCH 3/4] Update docs/src/index.md Co-authored-by: Isaac Wheeler <47340776+Ickaser@users.noreply.github.com> --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index f74d8639..e01b6d5b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -108,7 +108,7 @@ julia> unit_str = "kg/m^2" "kg/m^2" julia> units = uparse(unit_str) -kg m⁻² +kg m^-2 julia> 100 * units 100 kg m⁻² From 3b4b2297ef4c0148fc7365987c598c9290717747 Mon Sep 17 00:00:00 2001 From: Alex Gardner <32276930+alex-s-gardner@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:38:51 -0700 Subject: [PATCH 4/4] Update docs/src/index.md Co-authored-by: Isaac Wheeler <47340776+Ickaser@users.noreply.github.com> --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index e01b6d5b..50a45308 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -111,7 +111,7 @@ julia> units = uparse(unit_str) kg m^-2 julia> 100 * units -100 kg m⁻² +100 kg m^-2 ``` One useful interactive function is being able to convert to preferred (in this case SI) units.