Nov-20-2020, 07:52 PM
New coder here. I am working on code to create a simple MySQL table and I want a number value to have decimals. I used the DECIMAL data type and specified the digits and decimal places:
CREATE TABLE products3 (product VARCHAR(255), price DECIMAL(12,2), PRIMARY KEY(product))
I am able to commit data to it but when I select the data the number value looks like this:
('Lumber-2x4x96 inch', Decimal('5.50'))
I expected to see just the actual number value and not the "Decimal" with parenthesis. Am I doing something wrong or is there a way to strip off the non-number portion of the decimal value?
CREATE TABLE products3 (product VARCHAR(255), price DECIMAL(12,2), PRIMARY KEY(product))
I am able to commit data to it but when I select the data the number value looks like this:
('Lumber-2x4x96 inch', Decimal('5.50'))
I expected to see just the actual number value and not the "Decimal" with parenthesis. Am I doing something wrong or is there a way to strip off the non-number portion of the decimal value?