Explorar el Código

fix floating point change for decimals

horgh hace 16 años
padre
commit
8326c38ac8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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]} {