format value using field type