Thread $rkurs = sprintf ("%.2f",$kurs); (13 answers)
Opened by ak47 at 2003-10-16 16:52

havi
 2003-10-16 17:28
#64151 #64151
User since
2003-08-04
2036 Artikel
BenutzerIn
[Homepage]
user image
Ja!

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl

use warnings;
use strict;

my $kurs1 = 49,90;
print $kurs1 *2, "\n"; # 98 + Fehlermeldung von Perl bei einsetzen von use warnings;

my $kurs2 = 49.90;
print $kurs2 *2, "\n"; # 99.8

my $kurs3 = "49,90";
$kurs3 =~ s%,%.%g;
print $kurs3 *2, "\n"; # 99.8

1;


Gruss\n\n

<!--EDIT|havi|1066310975-->

View full thread $rkurs = sprintf ("%.2f",$kurs);