# Validating currency field against another currency field

**URL:** <https://community.gravityforms.com/t/validating-currency-field-against-another-currency-field/7868>\
**Category:** Get Help\
**Tags:** gform\_field\_validation, currency, gfcommon::to\_number, to\_number\
**Created:** [February 15, 2021, 12:54am UTC](https://community.gravityforms.com/t/validating-currency-field-against-another-currency-field/7868 "2021-02-15T00:54:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![longhead1153](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@longhead1153](https://community.gravityforms.com/u/longhead1153)\
**Post date:** [February 15, 2021, 12:54am UTC](https://community.gravityforms.com/t/validating-currency-field-against-another-currency-field/7868/1 "2021-02-15T00:54:10Z")

</div>

Hi,

How can I validate a number field against another number field in the same form? Both number fields are set to currency and I want to check that one value is not larger or equal to the other value. I’ve tried the gform\_field\_validation filter which works when the field is set to a number but not currency.

Thanks

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [February 15, 2021, 11:12pm UTC](https://community.gravityforms.com/t/validating-currency-field-against-another-currency-field/7868/2 "2021-02-15T23:12:39Z")

</div>

Take a look at example 2 [here](https://docs.gravityforms.com/gform_field_validation/#2-price-field-validation) for use of the `GFCommon::to_number` function to convert that currency to a number before evaluation.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:43am UTC](https://community.gravityforms.com/t/validating-currency-field-against-another-currency-field/7868/3 "2022-01-05T08:43:02Z")

</div>


