Hi:
I have a query that outputs an amount and name. The amount shows up like this 1222.45698 and I need it to NOT round off but need two decimal places. 1222.45 and no commas in between the numbers. How can I write the query to do this format.
Thanks
Z
Thanks Golom...it did work but it throws my calculation off for some reason. Ok how about this can I in vb code find where the decimal is and just have two numbers right of the deciamls.
For example:
657.3375
just be 657.33
75 falls off
thanks
Z
You are probably using a float data type (i.e. double or single). Those data types are approximations only which means that not every decimal number can be exactly represented. You should try the currency data type which is handled as an integer with a floating decimal point (max of 4 digits after the decimal.) From the previous example
Code:
cCur ( Format( Int([Amount]*100)/100, "0.00") )
If however, you are doing arithmetic with some other value and that other value is a float then VB may still convert to a float before doing the math. You may need to manually control the data type conversion to ensure that the math is done on Currency data types.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.