07/10/2013, 23:10 (Modification du message : 07/10/2013, 23:13 par CrazyCat.)
J'aurais bien vu:
tcl
proc octet_formatting {value {SI 1}}{if{$SI == 1}{set base 1024set u { Kio Gio Tio Pio }}else{set base 1000set u { Ko Go To Po }}if{$value<$base}{return"$value octets"}foreach unit $u{set value [expr{$value / $base.}]if{$value<$base}{return"[format %1.2f $value]$unit"}}}