Support for custom currencies


#1

Is there a way to use other currency than US dollar? We’ve some data that display currencies equivalence for products, but we’re using just numbers.


#2

Hi @ahmed. Custom currencies will be supported in next release 1.12. It will also allow you to use custom number formatting so you can place the currency symbol at the front or end of the number, use commas instead of periods and more.


#3

Hi, I have the same question and I noticed that ChartFactor 1.12 was released. Is this something possible now?


#4

Hi @sandip. Indeed, release 1.12 has included the support for custom currencies and formats for numbers. It also included custom formats for dates so you can provide your own. You can check the documentation for custom formats for numeric fields and custom formats for time fields. Let us know if you have any questions about it.


#5

hi guys, I don’t know if is here the correct place to ask, but the thing is that I have a numeric value that is the price of a product in USD dollars I want to convert this field to other currency and format him, how can I do this?


#6

hi @john you can do that combining a Derived Field with a Custom Currency Formatting Definition in the following way:

const dep1 = cf.Metric('fare', 'sum');
const fareInCAD= {
    'name': 'fare_cad',
    'label': 'Fare in CAD',
    'type': 'MONEY', 
    'currency': 'C$',
    'displayFormat': '0,0.00 $',
    'dependencies': [dep1],
    'function':  (fare) => fare / 0.76
};

let _META_ = {
  "chicago_taxi_trips": {
    "fields": {
      "fare_cad": fareInCAD
    }
  }
}

Let me know if you have additional questions. Best regards.