In a Libre Base query can anyone say why the following would fail to produce a numeric character with 4 decimals and instead return a column formatted as text showing two decimals? I want the query to store 4 decimals. Whether the internal CAST functions are included or not the column is always formatted as text. The data types of fs and ms_mass are both numeric with one decimal. Thanks.
CAST((CAST("fs_mass" AS DECIMAL (10,4)) + CAST( "ms_mass" AS DECIMAL (10,4)))*.001 AS DECIMAL (10,4))
It sounds like the problem is how the output is displayed. For example, with:
select 1.2345 + CAST((CAST(1.2 AS DECIMAL (10,4)) + CAST( 1.2 AS DECIMAL (10,4)))*.111 AS DECIMAL (10,4)) from "Table1";
the query result screen showed "1.5" at first. So I right-clicked on the column header, just above the first result, and went to Column Format. Change to a number with 4 decimal places.
Result: 1.5009
Running with Tools > SQL does not require this formatting.