metadata formatString not honored when number is generated with ifnull() | Will Holtz | 2016-03-02 13:54 |
Status: Closed | ||
I have a query: SELECT 0.111111111111111 AS a, ifnull(0.111111111111111, 1) AS b, CAST(ifnull(0.111111111111111, 1) AS NUMERIC) AS c; and metadata for the query: <?xml version="1.0" encoding="UTF-8"?> <query xmlns="http://labkey.org/data/xml/query"> <metadata> <tables xmlns="http://labkey.org/data/xml"> <table tableName="TestFormat" tableDbType="NOT_IN_DB"> <columns> <column columnName="a"> <formatString>##0.####E0</formatString> </column> <column columnName="b"> <formatString>##0.####E0</formatString> </column> <column columnName="c"> <formatString>##0.####E0</formatString> </column> </columns> </table> </tables> </metadata> </query> The output I get by viewing the data in the schema browser is: A B C 111.1111E-3 0.111111111111111 111.1111E-3 I was expecting to get: A B C 111.1111E-3 111.1111E-3 111.1111E-3 This is using postgres 9.5 with labkey revision 41716. I couldn't find any detailed documentation on ifnull() -- perhaps my expectations are just off. I can easily add a CAST to my query, so I'm no longer impacted by this. -Will |
||