Browse Source

fix floating point change for decimals

horgh 16 years ago
parent
commit
8326c38ac8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      calc.tcl

+ 1 - 1
calc.tcl

@@ -18,7 +18,7 @@ proc safe_calc {nick uhost hand chan str} {
 	}
 
 	# make all values floating point
-	set str [regsub -all -- {(\d+)} $str {[expr {\1*1.0}]}]
+	set str [regsub -all -- {((?:\d+)?\.?\d+)} $str {[expr {\1*1.0}]}]
 	set str [subst $str]
 
 	if {[catch {expr $str} out]} {