[) set n [expr $n%10000] } set skipped 0 foreach {i c} [list 1000 $dic(!1000) 100 $dic(!100) 10 $dic(10)] { if {$n/$i} { if {$res!="" && $skipped} {append res $dic(0)} append res $dic([expr $n/$i])$c set n [expr $n%$i] set skipped 0 } else { set skipped 1 } } if {$n} { if {$skipped} {append res $dic(0)} ;# filler zero append res $dic($n) } regsub ^$dic(1)$dic(10) $res $dic(10) res ;# avoid "yishi" regsub ^$dic(2)$dic(!10000) $res $dic(!2)$dic(!10000) res regsub $dic(2)$dic(!1000) $res $dic(!2)$dic(!1000) res set res } if 0 {Note however that this is more a proof of concept than a practical requirement for Chinese localization. Every Chinese using a computer is able and willing to understand numbers in the international style, so the above is useful only in full-text translation - or as a weekend fun project ;-) ---- [Natural languages] - [Chinlish] - [Arts and crafts of Tcl-Tk programming] - [Category Mathematics]