Too many decimal places...

SteveC24

Registered User.
Local time
Today, 10:41
Joined
Feb 1, 2003
Messages
444
Hi,

I have a form where the user enters a value for a temperature, for example, 20, and then selects whether they have entered fahrenheit or celsius. Whichever they select, the other is automatically calculated, using a formula I got off the net.

Anyway, if I put, for example, 99 degrees fahrenheit into the form, the celsius value is calculated (correctly) as 37.22222222 recurring.

I have put #.# into the format box of all the text boxes, and set the decimal places to 1, but it still shows as 37.222222. All I want is 37.2.

Thanks in advance for any help,
 
How about: 0.0 as the Format property?
 
Nope, with 0.0 as the format it still has loads of decimal places?!?

Thanks!
 
I was having a similar problem with calculated numbers and had to switch the data types to currency.
 
If all else fails...

=CLng(expression*100)/100
 
Thanks, I have looked at that, and it doesn't appear to work.

However, I have discovered something...

There are two text boxes (not visible) called TempAltMeasure1 and TempAltMeasure2. These are then combined in the final (visible) textbox like so:

Code:
 =[TempAltMeasure1] & " " & [TempAltMeasure2]

The value in "TempAltMeasure1" is the actual calculated value, and appears correctly as "37.2", then "TempAltMeasure2" is the measure used (for example, Degrees Celsius).

The number appears as "37.22222222222222" only in the combined text box...is this because of the text in there as well? If so, can I get round it, or should I stick to 2 text boxes visible?

Thanks
 

Users who are viewing this thread

Back
Top Bottom