proc to_eng: return arg as is if not valid expression

This commit is contained in:
stefan schippers 2025-02-26 16:01:32 +01:00
parent d3e0ca82b4
commit 43a8b62a24
1 changed files with 3 additions and 0 deletions

View File

@ -628,6 +628,9 @@ proc from_eng {i} {
## convert number to engineering form
proc to_eng {args} {
set suffix {}
if { [catch {[uplevel #0 expr [join $args]]} i] } {
return $args
}
set i [uplevel #0 expr [join $args]]
set absi [expr {abs($i)}]