half wasn't getting the right value. try this.... Prints 32
Code:Private Sub Form_Load() Dim tv As Currency tv = 2.1 half = 0.5 Debug.Print Int(tv * Val("15") + half) End Sub
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 15 of 41
Thread: INT Function Rounding ProblemsThreaded View
Tags for this Thread |
Click Here to Expand Forum to Full Width |