Add the sample code below to your child theme's functions.php file or in a site specific plugin.
<?php
//* Do NOT include the opening php tag
//* Remove decimals from total calculation in Gravity Forms
function gf_update_currency( $currencies ) {
$currencies['USD'] = array(
'name' => __( 'U.S. Dollar', 'gravityforms' ),
'symbol_left' => '$',
'symbol_right' => '',
'symbol_padding' => '',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 0
);
return $currencies;
}
add_filter( 'gform_currencies', 'gf_update_currency' );
Hello I implemented the same code for my Gravity forms in €.
The problem is that now stripe understands that 1€ = 0.01 €. I don't know how to fix that.
If I remove the code it works perfect, but then I still have to show the decimals.
//** Quitar deciamles de gravityforms
add_filter( 'gform_currencies', 'update_currency' );
function update_currency( $currencies ) {
$currencies['EUR'] = array(
'name' => __( 'Euro', 'gravityforms' ),
'symbol_left' => '€',
'symbol_right' => '',
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 0
);
return $currencies;
}