In the calculated field, I would check the value of the check box use that value to determine which formatted output to use. It should be noted that the result field should be a text field and read only. You would have to use JavaScript for the calculation since JavaScript supports formatted strings by using the "util.printf(cFormat, *)".