Jump to content
Sign in to follow this  
divinedesigns1

Database Question for Price

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Problem solved?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...