hi Felix
Alle 11:26, mercoledì 14 dicembre 2005, Felix E. Klee ha scritto:
> How do I perform an integer division (e.g. 11 / 3 = 4) in OpenOffice Basic?
in basic there is a \ operator (perhaps not documented)
but the result is rounded to the lower integer.
Anyway you can write your own function for rounding numbers, like the
following (not tested!! I wrote it directly on the mail-client :-)
regards
Paolo M
----------------8<---------------
Sub Test
Print RoundIt(11/3)
End Sub
Function RoundIt(Number) As Integer
Dim dDelta As Double
dDelta = Number - Int(Number)
If dDelta > 0.5 Then
RoundIt = Int(Number) + 1
Else
RoundIt = Int(Number)
End If
End Function
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]