From 22c373c645356f161d889866c36ae9eca4cbe074 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Thu, 23 Nov 2023 15:35:58 -0500 Subject: [PATCH] Special case scalar values in the info command --- numbat/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/numbat/src/lib.rs b/numbat/src/lib.rs index f587e076..0f4b9957 100644 --- a/numbat/src/lib.rs +++ b/numbat/src/lib.rs @@ -288,7 +288,14 @@ impl Context { + m::nl(); } - help += m::text("A unit of [") + md.readable_type + m::text("]") + m::nl(); + if matches!(md.type_, Type::Dimension(d) if d.is_scalar()) { + help += m::text("A dimensionless unit (") + + md.readable_type + + m::text("])") + + m::nl(); + } else { + help += m::text("A unit of [") + md.readable_type + m::text("]") + m::nl(); + } if let Some(defining_info) = self.interpreter.get_defining_unit(&full_name) { let x = defining_info