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
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