How can I format a cell to a custom number format other than scientific notation?

I need to format a cell using a standard notation, like in 1,23M for 1.230.000 or 432B for 431.998.005.345 i.e., but I can’t seem to find an answer by either formating the cell or using macros anywhere.

User-defined Number Formats

Number Format Codes