Skip to content

Currency

Filter

This filter identifies monetary amounts in text and reports them with the span type currency. An amount is detected when it has a currency symbol or a currency code before or after it:

  • A symbol before or after the amount: $, €, £, ¥, or ₹, such as $35.53, $ 100, €1.450,00, 250,50 £, and ₹500.
  • A code before or after the amount: USD, EUR, GBP, JPY, CAD, AUD, or INR, such as USD 1,234.56 and 5000 JPY. Codes are matched in any case, so 5 eur is detected.
  • Both, such as $3,450.75 USD, which is reported as one amount.

The digits may be grouped with commas or periods in either convention (1,450.00 or 1.450,00).

Not detected:

  • An amount without a symbol or one of those codes, such as 1,450 dollars or a bare 100.
  • Currencies written with other symbols or codes, such as 100 CHF.

Detection is based on the format of the text, so a value written this way that is not a monetary amount can be reported, and an amount written another way is not. Validate the results against your own documents.

Required Parameters

This filter has no required parameters.

Optional Parameters

Parameter Description Default Value
currencyFilterStrategies A list of filter strategies. None
enabled When set to false, the filter will be disabled and not applied true
ignored A list of terms to be ignored by the filter. None

The common filter properties also apply.

Filter Strategies

The filter may have zero or more filter strategies. When no filter strategy is given the default strategy of REDACT is used. When multiple filter strategies are given, they are evaluated in the order listed and only the first one whose condition is satisfied, or that has no condition, is applied. See Filter Strategies for details.

Strategy Description
REDACT Replace the sensitive text with a placeholder.
MASK Replace each character of the sensitive text with a mask character (* by default).
TRUNCATE Replace all but a few characters of the sensitive text with a truncation character (* by default).
RANDOM_REPLACE Replace the sensitive text with a similar, random value.
STATIC_REPLACE Replace the sensitive text with a given value.
CRYPTO_REPLACE Replace the sensitive text with its encrypted value.
HASH_SHA256_REPLACE Replace the sensitive text with its SHA256 hash value.
FPE_ENCRYPT_REPLACE Replace the sensitive text with a value generated by format-preserving encryption (FPE)
LAST_4 Replace the sensitive text with just the last four characters of the text.

Conditions

Each filter strategy may have one condition. See Conditions for details.

Conditional Description Operators
TOKEN Compares the value of the sensitive text. ==, !=, startswith
CONTEXT Compares the filtering context. == , !=
CONFIDENCE Compares the confidence in the sensitive text against a threshold value. < , <=, > , >=, ==, !=

Example Policy

{
   "identifiers": {
      "currency": {
         "currencyFilterStrategies": [
            {
               "strategy": "REDACT",
               "redactionFormat": "{{{REDACTED-%t}}}"
            }
         ]
      }
   }
}