Fix ignored scale on returned numerics

For example the numeric '50.34' in the db would be returned as '50.3400'. A
test for this has been added.