Tuesday, April 28, 2020

Wordpress, Gravity form - Remove space between currency symbol and amount

Wordpress, Gravity form - Remove space between currency symbol and amount


Remove space between currency symbol and amount

Please use the below WordPress in the theme Function (functions.php) file

add_filter('gform_currencies', 'update_currency');
function update_currency($currencies) {
    $currencies['GBP'] = array(
        'name' => __('Pound', 'gravityforms'),
        'symbol_left' => '£',
        'symbol_right' => '',
        'symbol_padding' => '',
        'thousand_separator' => ',',
        'decimal_separator' => '.',
        'decimals' => 2);
    return $currencies;
}

Change Currency symbol from left to right

Please use the below WordPress in the theme Function (functions.php) file:

add_filter('gform_currencies', 'update_currency');
function update_currency($currencies) {
    $currencies['GBP'] = array(
        'name' => __('Pound', 'gravityforms'),
        'symbol_left' => '',
        'symbol_right' => '£',
        'symbol_padding' => '',
        'thousand_separator' => ',',
        'decimal_separator' => '.',
        'decimals' => 2);
    return $currencies;
}

No comments: