Jump to content

Database Question for Price


divinedesigns1

Recommended Posts

if i want to display a price in my database which numeric should i used? i tried decimal but that didn't kept the whole price

 

any help will be appreciated as always

Link to comment
Share on other sites

What do you mean "didn't kept the whole price"?  Did you define how many decimals you wanted?

Link to comment
Share on other sites

i mean when i put into the database 10.00 it only displayed the 10 and no i didnt had the option of doing that in the database

Link to comment
Share on other sites

You might be confusing data storage with data representation. If you put a 10.00 in the database, it will store exactly 10, since the decimals aren't needed they're not shown. If you want to see the decimals, then your software will have to force a precision on the number when converting it to a string. I don't know what programming language you use, but it's up to the programming language to determine how the numbers are represented on the website or application.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...