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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zeros in decimal places

Status
Not open for further replies.

SJG0526

Programmer
Jul 5, 2002
108
US
I need to show zeros at the rightmost decimal place(s) if the user entered them. If they didn't, I don't want to show the zeros. Example:

entered 4.90 needs to show as 4.90 on all screens/reports and needs to be save in the database as 4.90

entered 4.9 in the same field, needs to show 4.9 on all screens/reports and save in the database as 4.9

These need to be treated as numbers, not strings

Possible?
 
Hello, this problem has been around for a while, I will be watching this thread.

In the past I have had two columns in my tables, one with a character string and one with the numeric. That way the trailing zeros are saved but you have a column to work with for calculations.

Good luck.
djj
 
I guess you'll have to save them as a string in the database and display them like that as far as a numerical value is concerned, 4.90 equals 4.9.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I believe you just handle them in your database as a string
and when you need to calculate convert the numbers to a decimal value or whatever you need

example:

DecimalNr = CDec(StringTextFromDatabase)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top