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.

Befehl für Kommazahlen

Empfohlene Antworten

Hallo!

Ich habe mal eine kurze Frage.

Gibt es in VB einen Befehl für Komma bzw. Ganzzahlen?

Beispiel: Wenn ich abfragen will ob es eine Ganzzahl oder eine Kommazahl ist.

If KOMMAZAHL Then......

Wenn ich meine Frage zu undeutlich gestellt habe, meldet euch bitte.

Hi Scherzkeks,

versuch's mal mit:

If VarType (Variable) = vbSingle OR VarType (Variable) = vbDouble Then

Wenn Du einfach eine Variable darauf prüfen möchtest, ob man sie als Zahl interpretieren kann, dann benutze IsNumeric (Variable)

Gruß

JayN

Ob es so eine Funktion gibt, weiss ich nicht genau. Auf jeden Fall gibt es eine, die dir sagt, ob es eine Zahl ist. Wie heisst sie nochmal? IsDigit oder so.

Was du machen könntest, ist eine eigene Funktion. Die nennst du dann IsFloat. Die macht dann nichts anderes, als die Zahl in ein String umzuwandeln, nach einem Komma bzw. Punkt suchen und dir das Ergebnis als boolean zurückliefern.

Easy oder?

Probiere es doch mal mit den VarType Befehl.

IfVarType(DeineVariable) = VbSingle then

Wichtig ist dabei event. noch, Integer und Longvariablen können nur Ganzzahlen aufnehmen. Singel, Double und Currency haben Nachkommastellen.

Ok, viellen Dank! Es hat hingehauen!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.