Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4855
| From | Andreas Neumann <an5275@sedo.com> |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | (s)printf max width |
| Date | 2022-09-17 15:49 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <tg4j8i$op8$1@gioia.aioe.org> (permalink) |
Tach, das Argument aus dem Subject gibt's wohl nicht für printf. Gibt es trotzdem eine Möglichkeit, eine Float-Zahl auf eine Anzahl Stellen zu begrenzen, ohne Fallunterscheidung? Meine Aufgabenstellung: Die floating-point number bewegt sich zwischen 0 und 99. Für Zahlen <10 möchte ich eine Ausgabe von z.B. "7.2", für >=10 möchte ich eine Ausgabe ohne Dezimalstellen, z.B "24". In beiden Fällen also mit nicht mehr als 2 Stellen. Ich hoffe ich habe mich verständlich ausgedrückt. Geht das ohne eine Fallunterscheidung aufzumachen?
Back to de.comp.lang.php | Previous | Next — Next in thread | Find similar
(s)printf max width Andreas Neumann <an5275@sedo.com> - 2022-09-17 15:49 +0200
Re: (s)printf max width Claus Reibenstein <creibens@gmail.com> - 2022-09-17 16:30 +0200
Re: (s)printf max width Claus Reibenstein <creibens@gmail.com> - 2022-09-17 16:47 +0200
Re: (s)printf max width Andreas Neumann <an5275@sedo.com> - 2022-09-17 17:15 +0200
csiph-web