Convert values to target field format

For the field calculator and virtual fields.

Fix #11000
Fix #10995
Fix #10993