Skip to main content
Easy Digital Downloads Documentation
Documentation, Reference Materials, and Tutorials for Easy Digital Downloads

edd_format_amount()

This function can be used for format a given price. It will return the result formatted to the correct number of decimals.

echo edd_format_amount( 9.5 );

You could combine it with edd_get_download_price() to return the formatted price for any download:

echo edd_format_amount( edd_get_download_price( $download_id ) );

If you wish to include a currency symbol you can filter the output with edd_currency_filter.

echo edd_currency_filter( edd_format_amount( edd_get_download_price( $download_id ) ) );