some simple questions (I hope)

Eyor

Registered User.
Local time
Today, 15:06
Joined
Jul 13, 2006
Messages
26
Please help, I need to write some code or function which will compare a numeric result field to a significant figures field and add decimal zeros if needed.

I've broken this into a few steps, if anyone can help answer any of these it would be a great help (I'm new to access and VB and am not sure if this is possible or not)

1. count the number of characters in the result field (numeric)

2. If number of characters in the result < value of significant figures

Then

3a. convert the numeric result to scientific notation, for example the number 9.7 would become 9 X 10(0) + 7 X 10(-1)

4. take the exponent of the last value subtract 1, call this value n

5. add 0 X 10(n) to the scientific notation of the result

6. convert the scientific notation result back to a standard numeric value and display this value

Else

7. return the result

I know it seems like a lot of work but, this will greatly simplify the results of a report and save time and lots of paper since results could be displayed in one row instead of a separate row for each result. Just knowing if this is possible would be a great help.
 
Eyor,

Yes a very simple question!

No easy answer though.

First, your numeric field is just that, a number. You can format it for
display in a multitude of ways. But, it's still just a number.

If this is an exercise into the representation of numbers as character
strings, then you can use the Len, Format and other such statements.
Most of it shouldn't be too difficult.

The string representation for scientific notation (with desired precision)
should be pretty interesting.

Let me know how you get on with this,
Wayne
 

Users who are viewing this thread

Back
Top Bottom