Convert to Single?

  • Thread starter Thread starter mo
  • Start date Start date
M

mo

I'm using the following formula to work out something called the MoMs
(Multiples of the Median) value for a particular field.

The formula looks like this:

MoMs = [TSH] / 10 ^ (0.5 +(0.12 * [GestAtSamp]))

TSH and GestAtSamp are fieldnames.

The formula works fine I think, but the result looks like this:

7.74823032843297E-13
1.10785436237887E-12
1.17358625532149E-12
7.46196196411902E-10
2.35371492406861E-11
1.23524715145244E-10

I'd like the formula to return a single to two decimals. Is there a way to
achieve this, or is there something wrong with my formula.

P.S. using Access2K and I'm doing this in code.
 
I'd like the formula to return a single to two decimals. Is there a way to
achieve this, or is there something wrong with my formula.

Use Round(<expression>, 2)

to round the result to two decimals. You can use CSng() to convert the
default Double Float to a Single, but this will give you approximately
seven decimals, not two.
 
I believe that all the values you posted will return Zero if you try to get them
down to one or two decimals places. So, the first thing I would do would be to
check your formula.

You might be able to use the CCur function or a round function to get the
decimal places down to something you wish. For instance

CCur(7.74823032843297E-13 * 10^12) will return 0.7748
CCur(7.74823032843297E-13) will return 0.
 
Back
Top