add support to use function to format the value