Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi @all,

gibt es eine möglichkeit eine Führende 0 zu behalten ? Und zwar meine ich damit Folgendes. Wenn ich z.B.: Folgendes mach:

expr 08 - 01 = 7

Ich würde aber gerne 07 als ergebnis bekommen, gibt es da eine Möglichekeit oder villeicht eine andere Lösung ?

Danke schon mal im voraus.

was dümmeres als:


echo "0$(expr 08 - 01)"

fällt mir nicht ein :D
Hi, danke für dein Post ... Ich hab so eine Ähnliche Lösung gehabt, aber ich hab dann gleich gemerkt dass, das nicht ist, weill wenn ich folgendes ausrechnen will
echo "0$(expr 11 - 01)" 

kommt nicht 10 sondern 010 raus :(


echo "$(expr 8 - 1)" | awk '{printf("%02d\n",$1)}'

printf "%02d" $(expr 8 - 1)

ist etwas einfacher. mit bash kann man es noch einfacher machen:

printf "%02d" $((8 - 1))

wenn für minuent und/oder subtrahent variablen verwendet werden, die zahlenbasis mit basis# angeben (führende 0 steht sonst für oktal).

-j

:D Danke für die Antworten ... Ihr habt mir wirklich weiter geholfen :D

gruß

geist_der_foren

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.