Thread Zahlen ausschreiben (17 answers)
Opened by bianca at 2016-07-27 09:16

FIFO
 2016-07-28 07:26
#185164 #185164
User since
2005-06-01
469 Artikel
BenutzerIn

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

printf( "%.${decimals}f", 1/3 );


Die {} um den Variablennamen musst Du setzen, sonst versucht Perl, eine Variable $decimalsf zu interpolieren.
Last edited: 2016-07-28 07:28:42 +0200 (CEST)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Zahlen ausschreiben