setting decimal places 
Author Message
 setting decimal places

hi

my problem is like this. I have "IncomeTax" field declared
as  a single data type. but the answer I get after
calculation has say seven or eight decimal places.
eg 1233.34579345497

how do I truncate this to 2 decimal places. say 1233.35

I really appreciate the help

thanks

daya



Sat, 17 Sep 2005 07:58:43 GMT  
 setting decimal places
Hi,

 You have to use Round function to round the values.

        Dim IncomeTax As Decimal
        IncomeTax = "1233.34579345497"
        IncomeTax = IncomeTax.Round(IncomeTax, 2)
Regards,
Prasanna Kakanoor

Quote:
>-----Original Message-----

>hi

>my problem is like this. I have "IncomeTax" field
declared
>as  a single data type. but the answer I get after
>calculation has say seven or eight decimal places.
>eg 1233.34579345497

>how do I truncate this to 2 decimal places. say 1233.35

>I really appreciate the help

>thanks

>daya

>.



Sat, 17 Sep 2005 21:42:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Setting Decimal places

2. Setting decimal places on reports using vba

3. Setting Decimal Places for a numeric column

4. How to set decimal places in Access 97 using VB6

5. How to set Decimal Places of a MS Access field using VB

6. How to set the decimal places in MS Access 97 using VB

7. format for fixed decimal places

8. Currency with only 4 decimal places !!!

9. Decimal places

10. Rounding to two decimal places (Access 97)

11. Fixed decimal places in VB code

12. (Q) Importing formatted XLS loses decimal places

 

 
Powered by phpBB® Forum Software