Advertisement
C_Volume2 VB function enhancement #76868

Another (very easy) Rounding Function

This code makes easy work of doing simple rounding on decimal number...something that VB currently lacks. Why didn't they think of this?

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
' Paste this code directly into your IDE. This has not yet been tested on VBScript, but should work if you drop the type declarations.

Function RoundNum(Number As Double) As Integer
If Int(Number + 0.5) > Int(Number) Then
  RoundNum = Int(Number) + 1
Else
  RoundNum = Int(Number)
End If

End Function

Upload
Commenti originali (3)
Recuperato da Wayback Machine