Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal number automatically rounds up! 1

Status
Not open for further replies.

SamDemon

Technical User
May 28, 2003
171
GB
This is probably going to be something really stupid, but i can not see how for the life of me i can do this!

What i want is for one of my fields to allow decimal places for the purpose of VAT (17.5). I have tried all the different combinations of numbers and they all round up to 18 when i put 17.5 in!

How can i get my table to store these numbers as decimals??

Thanks in advance!

Sam

It's just common sense, shame sense isn't common!
 
You are probably experimenting with byte, integer and long integer as field size. Try Single or Double, or for accuracy, either the Decimal field size, or the Currency datatype.

Could also be you've set the number of decimals to 0?

Roy-Vidar
 
Thanks Roy-Vidar,

I had been trying to get the integer and long integer to work with all different types of combinations!

Sam

It's just common sense, shame sense isn't common!
 
For the data type of the field, set

Field Size: Decimal
Format: Standard
Precision: 18 (or less -- this is the total number of digits that will store both left and right of the decimal point)
Scale: 1 (if you want 1 digit to the right of the decimal point, 2, if you want 2, etc.)
Decimal Places: 1 or 2, etc.
Any form or report you create AFTER making these changes will use this format. If you have a form you have already designed, you will need to open the form-field properties and set its properties similar to those for the table.

Hope this helps.

dr
 
Swtrader -
Thanks you totally saved me today. Pulling my hair out just trying to figure this out!
-drmgrl [ponytails]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top