I have a SQLite3 table with a column that has the format DECIMAL (7,2), but whenever I select rows with values that do not have a non-zero 2nd decimal place (e.g. 3.00 or 3.10), the result always has zero (s ) missing (e.g. 3 or 3.1). Is there a way I can apply the formatting function in a SELECT statement to get the required 2dp? I tried ROUND (), but this has no effect. Otherwise, I will have to convert the resulting column values to the required format for display (using Python in my case) every time I do a SELECT statement, which is a real pain.
I don't even mind if the result is a string instead of a number, if it has the correct number of decimal places.
Any help would be greatly appreciated.
Alan
source
share