tcl
proc add_thousand_separators {value} {
return [::tcl::string::trimleft [::tcl::string::reverse [regsub -all {...} [::tcl::string::reverse $value] {& }]] " "]
}
Exemple a écrit :add_thousand_separators 16165152
Tcl: 16 165 152
ou
tcl
proc add_thousand_separators {value} {
return [::tcl::string::trimleft [::tcl::string::reverse [regsub -all {...} [::tcl::string::reverse $value] {&.}]] "."]
}
Exemple a écrit :add_thousand_separators 16165152
Tcl: 16.165.152
Source : http://www.boulets.oqp.me/tcl/routines/t...-0001.html