WordPress core has number_format_i18n()
function, which allows to set number of decimal digits and apploes appropriate formatting in line with site’s locale.
However note that it is not specific to money and there can be more peculiar requirements to handle such.