Created
April 26, 2017 21:14
-
-
Save attilabacso/fe3b53527cd4e396900be717a767d4bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put functions.php | |
add_filter('give_format_amount', 'give_remove_thousands_seperator'); | |
function give_remove_thousands_seperator($amount, $decimals = true) { | |
$thousands_sep = ''; | |
$decimal_sep = give_get_option( 'decimal_separator', '.' ); | |
if ( empty( $amount ) ) { | |
$amount = 0; | |
} else { | |
// Sanitize amount before formatting. | |
$amount = give_sanitize_amount( $amount ); | |
} | |
$decimals = $decimals ? give_get_price_decimals() : 0; | |
$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep ); | |
return $formatted; | |
} | |
add_filter('give_global_script_vars', 'give_remove_thousands_js_autoformatting'); | |
function give_remove_thousands_js_autoformatting($args) { | |
$args['thousands_separator'] = ''; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment