Page 1 of 1

rounding in a user-defined function

Posted: Wed Apr 09, 2008 4:08 pm
by Rainer
Hi,

how can I round a value in a user-defined function

Rainer

Re: rounding in a user-defined function

Posted: Wed Apr 09, 2008 4:14 pm
by Villeroy
In a spreadsheet?
=ROUND(myFunction(args);2)

Re: rounding in a user-defined function

Posted: Wed Apr 09, 2008 4:23 pm
by Rainer
Hi Villeory,

I know how to round in a spreadsheet itself, but how do I in a user-defined function?

e.g.

Function Test as Single
Dim value as Single

value = 2 / 3
Test = ROUND(value,1)
End Function

The examples doesn't work?


Rainer

Re: rounding in a user-defined function

Posted: Wed Apr 09, 2008 4:36 pm
by Villeroy
Do yourself a favour and let it happen on the sheet if possible. Search this forum as well as oooforum.org for keywords "FunctionAccess" and "callFunction". Service "FunctionAccess" includes a lot of pitfalls if you are not familiar with this beast of an API.