Convert decimals to whole numbers 
Author Message
 Convert decimals to whole numbers

I have a textbox called text0 on a form called FRMmanlabs.  the decimal
places is set too 3 and the format is set to fixed.
When I run the report to I need to be able to change the following.
If the user enters a value of less than 1 in the text0 textbox I want to
convert the number from a decimal to a whole number. The textbox on the
report is called tare and the report is called rptmanlabs.
I know this sounds strange, what i want to do but  i need to convert from
parts of a kilo into grams.
Could anybody help me with the code required to do this??

Thanks in advance

Andy Ingall



Sun, 05 Jan 2003 03:00:00 GMT  
 Convert decimals to whole numbers
Andrew,
If you just want to make this change on the report, and only if the value is
less than one, then this may help.
Have the value control on the report with visible = false, called say
txtValue.
Another control, that will actually display the result would then have a
Control Source of something like;
= IIF(txtValue<0,format(txtValue*1000,"000") & "g",Format(txtValue,"0.000")
& "kg")
I think this will give you the results you seek, but I have not checked it
(or the syntax).

--
Hope This Helps,
Jeff Davies


Quote:
> I have a textbox called text0 on a form called FRMmanlabs.  the decimal
> places is set too 3 and the format is set to fixed.
> When I run the report to I need to be able to change the following.
> If the user enters a value of less than 1 in the text0 textbox I want to
> convert the number from a decimal to a whole number. The textbox on the
> report is called tare and the report is called rptmanlabs.
> I know this sounds strange, what i want to do but  i need to convert from
> parts of a kilo into grams.
> Could anybody help me with the code required to do this??

> Thanks in advance

> Andy Ingall



Mon, 06 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Exporting a 3 decimal number to text file produces trunc 2 decimal text number

2. convert a decimal number to fraction.

3. Decimal problems when converting to number

4. help: need to convert decimal numbers into binary

5. Code for converting decimal floating point numbers in VB6

6. Converting Roman Numbers to Decimal

7. converting 64bit numbers to hexidecimal and decimal

8. Decimal problems when converting to number

9. convert label caption text to decimal number

10. Code for converting decimal floating point numbers in VB6

11. Help: how to Convert a decimal number to binary

12. Convert decimal comma to decimal point

 

 
Powered by phpBB® Forum Software