Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active December 28, 2015 11:19
Show Gist options
  • Select an option

  • Save amdrew/7493010 to your computer and use it in GitHub Desktop.

Select an option

Save amdrew/7493010 to your computer and use it in GitHub Desktop.
<?php
// set decimal places to 8
function my_child_theme_edd_format_amount_decimals( $decimal_places ) {
return 8;
}
add_filter( 'edd_format_amount_decimals', 'my_child_theme_edd_format_amount_decimals' );
// format final amount with (float)
function my_child_theme_edd_format_amount( $formatted, $amount, $decimals, $decimal_sep, $thousands_sep ) {
return (float) $formatted;
}
add_filter( 'edd_format_amount', 'my_child_theme_edd_format_amount', 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment