Input appreciated

  • Thread starter Thread starter Gerald
  • Start date Start date
G

Gerald

Ok I am in the process of convereting a database that is having issues on
some conversion problems.

I know of two ways to perform the math and get the answer though one is
proving a bit quirrly atm as when a number that is less than one say creates
a cascade effect on the remaining fields.

Ok let me list the ways I know of:

ok lets say we have field names P G S C for our example

Method one:
Convert all input to lowest value (C)
the ratios are as follows:
P is 1:10000000
G is 1:10000
S is 1:100
C is 1:1

So method one requires to steps if there is any math performed.

Convert down to C and then do math then convert Back into the spread P G S
C.

Confusing and as I am finding error prone especially if you end up with any
of the higher amount with an amount less than 1.

Method 2:

Using the information from method one the other I can think of would be work
in the reverse.

It takes 100 C to make 1 S
It takes 100 S to make 1 G
It take 1000 G to make 1 P

and there is nothing after P so it would simply increase in increments.

Ok now if I took int val of c/100 and added that to S and then subtracted
that from the total od c and what was left would be the amount shown

Then repeat for the others S and G

P simply jsut adds to itsself as needed by the carry over from G.

I hope this is enough example if not let me know where the problem is so I
can try and clarify.

This will probably lead to a second question but I want to confirm which
method is actully more reliabel and less error prone.


Thanks ahead of time
 
Gerald

Given that you appear to have a math/calculation issue, is there a reason
you are not handling this in a spreadsheet?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
The calculations are based off information listed within the database like a
running total for items they enter within the subform. So the total varies
depending on what the subform shows for the record. as the value is not
stored permenatly no need to owrry about answer past the inital creation.
 
I have found the answer to my question and answered it while I was typing
the group out as well.

I simply tool the final vaule and worked in reverse of what I thought I
should ie

P = int(total/10000000)
G=int((total- (P*10000000))/10000)
S=int((total-(P*10000000)-(G*10000))/100)
C=int((total-(P*10000000)-(G*10000)-(S*100)))

And have run everal runs using normal and what I call the error input and
idiot input testing. and the answers are correct over any input. Also
discovered that this formula allows for one thing they wanted to do all
along and that is allow fo markup values by simply taking the base amount in
C format and adding the amount gotten by (C*markup)

so the answer was there and after typing here it hit me on how.

Gerald
 
Back
Top