I have a result of a calculation that displays in a text box on my form.
I have dimensioned my numbers as double.
The result of the calculation could look like this:
Sample Answer 1 = 662.102106929135
Sample Answer 2 = 66210210.234
I want all my answers to display with 8 digits (excluding decimals or +- sign)
Sample Answer 1 should display as 662.10210
Sample Answer 2 should display as 66210210
Any idea how I can accomplish this?
I need to keep my numbers dimensioned as double; otherwise I run into a whole other issue.
I have an idea, but I'm not sure how to code it. My idea goes something like this:
num1 = 66210210.234
x = Len(num1)
x1 = total number of decimals and +- signs in the number
x2 = x - x1 (substract the number of decimals and +- signs from the original length of the number
If x2 > 8 then Left(x2, 8)
If this will work, could someone help me to code it?
I'd really appreciate some help with this. THANKS! BJS
I have dimensioned my numbers as double.
The result of the calculation could look like this:
Sample Answer 1 = 662.102106929135
Sample Answer 2 = 66210210.234
I want all my answers to display with 8 digits (excluding decimals or +- sign)
Sample Answer 1 should display as 662.10210
Sample Answer 2 should display as 66210210
Any idea how I can accomplish this?
I need to keep my numbers dimensioned as double; otherwise I run into a whole other issue.
I have an idea, but I'm not sure how to code it. My idea goes something like this:
num1 = 66210210.234
x = Len(num1)
x1 = total number of decimals and +- signs in the number
x2 = x - x1 (substract the number of decimals and +- signs from the original length of the number
If x2 > 8 then Left(x2, 8)
If this will work, could someone help me to code it?
I'd really appreciate some help with this. THANKS! BJS