Frage zur printf Formatierung
-
hi
habe eine kurze frage
kann mir jemand erklären (oder link zu tutorial) wie man die ausgabe von printf formatieren kann?ich möchte das er bei meiner variable "float test=3.06" nur 2 komma zahlen ausgibt
derzeit gibt er es so ca aus " 3.06000000"danke schonmal im vorraus
-
Hallo,
kurze Antwort: "%.2f" ist die gesuchte Formatierungszeichenkette, und einer von (unzähligen) Links ist
http://home.fhtw-berlin.de/~junghans/cref/FUNCTIONS/format.html
MfG