### [How to Create a New Currency Symbol for WPForms](https://wpforms.com/developers/how-to-create-a-new-currency-symbol-for-wpforms/)

**Published:** November 25, 2019
**Author:** Umair Majeed

**Excerpt:** This tutorial will show you how to create new currencies to use for your WPForms Payment settings. 

**Content:**

Would you like to create a new currency symbol for your WPForms? WPForms already has many currencies to choose from, however, if you would like to add a new symbol or simply just move the position of an already existing currency symbol, this is easily achievable. This tutorial will walk you through the steps of adding a new currency to your WPForms.

## Creating a new currency symbol

The code below will add **Lira** currency as an option under **WPForms » Settings » Payments** tab. Just add the code snippet below to your site.

If you need any help in adding snippets to your site, [please check out this tutorial.](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms")

```

/**
 * Add a new currency symbol
 *
 * @link https://wpforms.com/developers/how-to-create-a-new-currency-symbol-for-wpforms/
 */

function wpf_dev_currencies( $currencies ) {

    $currencies['LRA'] = array(
        'name'                => esc_html__( 'Lira', 'wpforms' ),
        'symbol'              => '₤',
        'symbol_pos'          => 'right', // enter left or right to position the symbol
        'thousands_separator' => ',',
        'decimal_separator'   => '.',
        'decimals'            => 2,
    );

    return $currencies;
}

add_filter( 'wpforms_currencies', 'wpf_dev_currencies', 10, 1 );

```

Once you’ve added the snippet, you can go to the **WPForms** » **Settings** » **Payments** and select your new currency from the **Currency** dropdown list.

![You haveve now used PHP to create a new currency symbol](https://wpforms.com/wp-content/uploads/2019/11/wpforms-new-currency-setting.jpg)## More Examples

Here are some further examples.

#### Euro

```

/**
 * Add a new currency symbol - Euros
 *
 * @link https://wpforms.com/developers/how-to-create-a-new-currency-symbol-for-wpforms/
 */

function wp_add_currencies( $currencies ) {

    $currencies['EUR'] = array(
        'name'                => esc_html__( 'Euro', 'wpforms' ),
        'symbol'              => '€',
        'symbol_pos'          => 'left', // LEFT
        'thousands_separator' => '.',
        'decimal_separator'   => ',',
        'decimals'            => 2,
    );

    return $currencies;
}

add_filter( 'wpforms_currencies', 'wp_add_currencies', 10, 1 );

```

#### Hong Kong Dollar

```

/**
 * Add a new currency symbol - Hong Kong Dollar
 *
 * @link https://wpforms.com/developers/how-to-create-a-new-currency-symbol-for-wpforms/
 */

function wp_add_currencies( $currencies ) {

    $currencies['HKD'] = array(
        'name'                => esc_html__( 'Hong Kong Dollar', 'wpforms' ),
        'symbol'              => '$',
        'symbol_pos'          => 'left', // LEFT
        'thousands_separator' => ',',
        'decimal_separator'   => '.',
        'decimals'            => 2,
    );

    return $currencies;
}

add_filter( 'wpforms_currencies', 'wp_add_currencies', 10, 1 );

```

And that’s it! You’ve now added a new currency to your WPForms. Would you like to know how to change the position of the description? Take a look at our tutorial on [How to Position the Field Description Above the Form Field](https://wpforms.com/developers/how-to-position-the-field-description-above-the-form-field/ "How to Position the Field Description Above the Form Field").

## Reference Filter

[wpforms\_currencies](https://wpforms.com/developers/wpforms_currencies/ "Using wpforms_currencies Filter")

## FAQ

#### Q: How can I move the currency symbol?

Please note, customizing the `decimals` positioning of any currency could break the currency on any of the WPForms payment addon. The payment process would ignore the decimal values.

**A:** In this example, we’ll move the U.S. Dollar (USD) symbol from the left to the right using the following snippet.

```

/**
 * Add a new currency symbol
 *
 * @link https://wpforms.com/developers/how-to-create-a-new-currency-symbol-for-wpforms/
 */

function wpf_dev_currencies( $currencies ) {

    $currencies['USD'] = array(
        'name'                => esc_html__( 'U.S. Dollar', 'wpforms' ),
        'symbol'              => '$',
        'symbol_pos'          => 'right', // left or right
        'thousands_separator' => ',',
        'decimal_separator'   => '.',
        'decimals'            => 2,
    );

    return $currencies;
}

add_filter( 'wpforms_currencies', 'wpf_dev_currencies', 10, 1 );

```

![Now the symbol has been moved from showing on the left to showing on the right.](https://wpforms.com/wp-content/uploads/2019/11/wpforms-move-currency-example.jpg)Simply by adding the **‘symbol\_pos’ => ‘left’,** or **‘symbol\_pos’ => ‘right’,** you are moving the position of the currency from one side to the other.

#### Q: How do I remove the decimal point?

**A:** Currently, the `'decimals' => 2,` will not accept a zero amount after the decimal point. This is needed for the filter.

**Categories:** Extending

**Tags:** PHP

---

