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.

Runden auf 2 Nachkommastellen

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich habe nur ne kleine Frage!

Hab ne Variabel vom Typ Single. Jetzt will ich sie auf 2 Nachkommastellen runden. Ich hab dafür aber keine Funktion gefunden!

Weis jemand von euch eine??? Ich mach VBA unter Access 97

Gruß Sonic83

Hallöchen,

ist doch ganz einfach:

runden(zahl, anzahl_stellen)

z.B.: runden("3.85284", 2)

Ergebnis: 3,85

- ohne anzahl_stellen, wird vor dem Komma gerundet -

Viel Spaß damit. :)

Also so geht es nicht. Und die Methode Round wie in VB gibt es komischer Weise auch nicht!

Hallo!

Versuchs mal so: ( x = deine Variable )

Format(x, "0.00")

Dann müsste Deine Zahl eigentlich auf 2 Stellen gerundet sein.

Gruss

Danke mit Format funktioniert es!!!

Hallo, liebe Leute.

Auch wenn das Problem schon geloest ist, habe ich (vielleicht fuer die Zukunft?) eine Lösung unter VBA parat, falls es mal mit Format nicht klappen sollte, bzw. eher, dass eine "variable" Anzahl Nachkommastellen (NkSt) gewünscht ist (ansonsten faellt Euch bestimmt ein Verwendungszweck ein...):

_____

Function MeinRunden(DeineZahl, NkSt)

MeinRunden = _

(Int(DeineZahl * 10 ^ NkSt + 0.5)) / 10 ^ NkSt

End Function

_____

Bei dieser Funktion klappt es auch mit negativen Zahlen fuer NkSt: es wird dann vor dem Komma (kaufmännisch) gerundet (wie bei der internen Funktion Runden() auch).

Gruss

und weiterhin viel Spass

piomode1

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.