Kaynağa Gözat

fix floating point change for decimals

horgh 16 yıl önce
ebeveyn
işleme
8326c38ac8
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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]} {