I'm trying to pass conditional string formatting from a function back to style.format as shown here....

Ultimately, I'm looking for the same results as above EXCEPT {:.3f}m should be 3.000m in the output displayed dataframe. Any ideas?
Thank you,
Tyler
Here's the code for testing:
df = pd.DataFrame([[np.nan, 1.0, 'A'], [2.0, np.nan, 3.0]])
df
func = lambda s: 'STRING' if isinstance(s, str) else '{:.3f}m'
df.style.format({0: '{:.3f}m', 2: func}, na_rep='MISS')