From d5287f36288d40fb54384ad259984e6382e63d09 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 25 Mar 2026 16:50:05 +0200 Subject: refactor: Update Show command to format boolean values correctly - Changed Show to use val.String() instead of NewNumber(toNumber(val), o.mode) - Boolean values now display as 'true'/'false' instead of '1'/'0' - Number values preserve their numeric formatting The Show command now correctly handles mixed boolean-numeric stacks, displaying booleans as 'true'/'false' and numbers with appropriate precision. --- internal/rpn/operations.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/rpn/operations.go b/internal/rpn/operations.go index 5231ed6..3bd0fc1 100644 --- a/internal/rpn/operations.go +++ b/internal/rpn/operations.go @@ -684,9 +684,10 @@ func (o *Operations) Show(stack *Stack) (string, error) { if i > 0 { result += " " } - // Use Number interface for consistent formatting with the current mode - num := NewNumber(toNumber(val), o.mode) - result += num.String() + // Use Value.String() to format values correctly: + // - Boolean values show as "true"/"false" + // - Number values show with appropriate precision + result += val.String() } return result, nil } -- cgit v1.2.3