Sqlite uses .
, not ,
for the decimal point in a floating pointer number (Do any sql databases accept a comma for it?).
When you multiply a number (4
) by a string ('99,99'
) the leading numeric portion of the string is converted to a number, so you’re seeing the result of 4 * 99
. (SELECT typeof(precio) FROM yourtable
will be text
, not real
).
SELECT 4*99,99
returns two columns – one 4*99
, one 99
, because comma is the column/value separator.
Some useful reading:
-
More about datatypes in sqlite3 including rules for conversion between types.
-
Syntax of numeric literals in sqlite3 (Which specifically mentions that it always uses period and never comma).
solved Problem doing multiplication operation in a select between a float and an integer in sqlite [closed]