How to dynamically get the figure number as a string?

Many thanks! I was aware of How to make captions italic? and I was trying work out the solution that @Electron_Wizard showed me but I also add @bluss detail.