divinedesigns1 Posted January 27, 2020 Share Posted January 27, 2020 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 More sharing options...
niche Posted January 27, 2020 Share Posted January 27, 2020 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 More sharing options...
divinedesigns1 Posted January 29, 2020 Author Share Posted January 29, 2020 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 More sharing options...
niche Posted January 29, 2020 Share Posted January 29, 2020 Problem solved? Link to comment Share on other sites More sharing options...
Ingolme Posted January 30, 2020 Share Posted January 30, 2020 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. 1 Link to comment Share on other sites More sharing options...
niche Posted January 30, 2020 Share Posted January 30, 2020 one way to use fox's info, in php, is number_format() https://www.php.net/manual/en/function.number-format.php 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now