Using dynamic currency with Numeral.js

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.9.0

Describe the issue:
I’m working on a metric visualization where I have to display the total revenue for a specified month with a currency symbol in front of the total amount but I got stuck. I’ve imported the sample e-commerce data and was able to see how was done there so I’ve managed to create a sum of the order_total field in my case but I got stuck with the currency symbol. It seems like OpenSearch allows to display of only the $ symbol and not any others. Is that true?


I’ve created a scripted field with the following configuration:

  1. Name - order_total_with_currency
  2. Language - painless
  3. Type - number
  4. Format - Number
  5. Numeral.js format pattern - $ 0,0.[000]
  6. Script - return doc[‘order_total’].value;

The issue here is that the only possible currency it seems to be a Dollar one and no other is available.

Keep in mind that it’s possible to have multiple sites with different currencies so I have to manage all of them not display only in USD ($). Is that possible to be created? I’ve tried to put the currency value dynamically in front of the order_total value but then I can not use the SUM aggregation since it can be used only for numbers.

Any solutions?

Relevant Logs or Screenshots: