Hallo mit folgendem Script versuche ich Zahlenwerte umzuwnandeln:
Dabei soll z.B. aus X -> X,00 € werden und aus 12.8 -> 12,80 € usw.
Ich hab jetzt schon einige Seiten durchsucht und bin auch auf obigen Ansatz gestoßen, nur leider wird aus 17 nicht 17,00 € sondern nur 17 €
Dabei soll z.B. aus X -> X,00 € werden und aus 12.8 -> 12,80 € usw.
sprintf("%01.2f", $zahl);
$zahl = str_replace('.', ',', $zahl);
$zahl = $zahl." €";
return $zahl;
$zahl = str_replace('.', ',', $zahl);
$zahl = $zahl." €";
return $zahl;

Kommentar