Skip to content

Commit

Permalink
Special case scalar values in the info command
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Nov 23, 2023
1 parent 341ca6d commit 71ec1fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion numbat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71ec1fb

Please sign in to comment.