Hi all
I know this is not the right place to be asking about this but I asked on
the oooforum but got no replies and thought that since there are so many
smart cookies on this list that perhaps someone might know the solution to
my problem. I am a REAL NEWBIE on this BASIC scripting!
I've written a User Defined Function (UDF) in scalc for calculating income
tax at different rates for NZ's various tax brackets. The only problem is
that I need to use the builtin ROUNDDOWN function (to truncate the cents)
in my UDF. I'm guessing that because the ROUNDDOWN function is not
explicitly defined in my UDF I get a 'BASIC runtime error':
"Sub-routine procedure or function procedure not defined."
Here's a piece of my code:
<start code>
ElseIf GrossPay > 182 And GrossPay < 731 Then
RoundGP = ROUNDDOWN(GrossPay, 0)
AI = RoundGP*52
PAYE = (0.21*AI)-570
AEarnLevy = 0.012*AI
WDed = (PAYE + AEarnLevy)/52
Tax1 = ROUNDDOWN(WDed, 2)
<end code>
What I need to know is:
1. Is my assumption correct - that I need to include the ROUNDDOWN function
in my UDF?
2. If so, how do I do that if I don't know what actual code is used for
that builtin function? I've googled and googled and now I'm cross-eyed!
3. Am I way off track or perhaps my requirement is impossible?
Any help would be muchly appreciated.
Cheers
Sharrea
--
Help Microsoft stamp out piracy - give Linux to a friend today
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com