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