Thread sprintf: anstatt 2007 => 07 (1 answers)
Opened by Froschpopo at 2007-12-21 16:34

Linuxer
 2007-12-21 16:43
#104100 #104100
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
Code (perl): (dl )
1
2
3
my $year = 2007;

printf "%02s\n", $year%100;
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread sprintf: anstatt 2007 => 07