The Blackbody radiation spectrum, or Planck function, can be expressed in a number of ways. There are various choices of units but we use examples with a specific set of units in order to clearly illustrate the physical nature of each function. The notation $B$ denotes the intensity spectrum (per unit solid angle), and the notation $u$ donates the energy density (energy per unit volume). The energy density is related to the intensity simply by multiplying the latter by $4\pi/c$ for isotropic radiation, summed over all directions. However, if you are dealing with a general angular distribution of radiation you have to start with the energy density per unit solid angle, in which case you would multiply by $1/c$ instead of $4\pi/c$. You would then integrate over solid angle. For the case of isotropic radiation, for example, at a particular frequency, $\nu$,

$u_{\nu} = \frac{4\pi}{c} B_{\nu} \ \ \ {\rm erg \ cm^{-3} \ Hz^{-1}}$

To get the number density, $n_{\nu}$, (photons per unit energy, divide the energy density by the energy of one photon, i.e. $h\nu$, $E$, or $hc/\lambda$. Thus

$n_{\nu} = \frac{4\pi}{c h \nu} B_{\nu} \ \ \ {\rm cm^{-3} \ Hz^{-1}} \\ n_{\lambda} = \frac{4\pi \lambda}{h c^{2}} B_{\lambda} \ \ \ {\rm cm^{-3} \ cm^{-1}} \\ n_{E} = \frac{4\pi}{c E} B_{E} \ \ \ {\rm cm^{-3} \ erg^{-1}} \\$

As for the blackbody spectrum or Planck function itself, in terms of frequency:

$B_{\nu} = \frac{2h\nu^{3}}{c^{2}} \frac{1}{\exp{(h\nu/kT)}-1} \ \ \ {\rm erg \ cm^{-2} \ s^{-1} \ Hz^{-1} \ steradian^{-1}}$

In terms of wavelength:

$B_{\lambda} = \frac{2hc^{2}}{\lambda^{5}} \frac{1}{\exp{(hc/\lambda kT)}-1} \ \ \ {\rm erg \ cm^{-2} \ s^{-1} \ cm^{-1} \ steradian^{-1}}$

In terms of energy:

$B_{E} = \frac{2E^{3}}{c^{2}h^{3}} \frac{1}{\exp{(E/kT)}-1} \ \ \ {\rm erg \ cm^{-2} \ s^{-1} \ erg^{-1} \ steradian^{-1}}$

Tip: In going between the different forms of the blackbody spectrum, you
need to use:

$E = h\nu, \ \ \ \ {\rm d}E = h{\rm d}\nu$

and, using $c=\nu \lambda$,

$\nu = \frac{c}{\lambda}, \ \ \ \ {\rm d}\nu = -\frac{c \ {\rm d}\lambda}{\lambda^{2}}$