I have tried removing the extra zeroes by using trim(trim(both '0' from fld)). But this results in getting the value 0.0000 as '.'. I have also tried converting the decimal part as integer and appending with '.'. This gives me the result but I want to know if any formatting can do it in an easy way.
- TRIM(LEADING '0' FROM fld) or - TRIM(BOTH '0.' FROM fld) or - Cast it to VARCHAR and then export, or - Use FORMAT as follows: SELECT CAST('0.001' AS DECIMAL(7,4) FORMAT 'Z9,9999'); --> 0.0010 SELECT CAST('99.001' AS DECIMAL(7,4) FORMAT 'Z9,9999'); --> 99.0010 SELECT CAST('0.0000' AS DECIMAL(7,4) FORMAT 'Z9,9999'); --> 0.0000