From 3abd9957aaae5a3d242b9e4098a353ea7c2d5e23 Mon Sep 17 00:00:00 2001 From: Muhammad Hendri Date: Mon, 26 Oct 2020 14:17:53 +0700 Subject: [PATCH] Currency: Adds Indonesian IDR currency (#28363) --- packages/grafana-data/src/valueFormats/categories.ts | 1 + packages/grafana-data/src/valueFormats/valueFormats.test.ts | 1 + public/app/core/utils/kbn.test.ts | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/grafana-data/src/valueFormats/categories.ts b/packages/grafana-data/src/valueFormats/categories.ts index 4507fa1951c..645d41db15b 100644 --- a/packages/grafana-data/src/valueFormats/categories.ts +++ b/packages/grafana-data/src/valueFormats/categories.ts @@ -126,6 +126,7 @@ export const getCategories = (): ValueFormatCategory[] => [ { name: 'South African Rand (R)', id: 'currencyZAR', fn: currency('R') }, { name: 'Indian Rupee (₹)', id: 'currencyINR', fn: currency('₹') }, { name: 'South Korean Won (₩)', id: 'currencyKRW', fn: currency('₩') }, + { name: 'Indonesian Rupiah (Rp)', id: 'currencyIDR', fn: currency('Rp') }, ], }, { diff --git a/packages/grafana-data/src/valueFormats/valueFormats.test.ts b/packages/grafana-data/src/valueFormats/valueFormats.test.ts index 51731f66998..ad9bc4566eb 100644 --- a/packages/grafana-data/src/valueFormats/valueFormats.test.ts +++ b/packages/grafana-data/src/valueFormats/valueFormats.test.ts @@ -16,6 +16,7 @@ const formatTests: ValueFormatTest[] = [ // Currency { id: 'currencyUSD', decimals: 2, value: 1532.82, result: '$1.53K' }, { id: 'currencyKRW', decimals: 2, value: 1532.82, result: '₩1.53K' }, + { id: 'currencyIDR', decimals: 2, value: 1532.82, result: 'Rp1.53K' }, // Standard { id: 'ms', decimals: 4, value: 0.0024, result: '0.0024 ms' }, diff --git a/public/app/core/utils/kbn.test.ts b/public/app/core/utils/kbn.test.ts index 3bf5b44cfe7..7ab32354e7d 100644 --- a/public/app/core/utils/kbn.test.ts +++ b/public/app/core/utils/kbn.test.ts @@ -11,9 +11,10 @@ interface ValueFormatTest { } const formatTests: ValueFormatTest[] = [ - // Currancy + // Currency { id: 'currencyUSD', decimals: 2, value: 1532.82, result: '$1.53K' }, { id: 'currencyKRW', decimals: 2, value: 1532.82, result: '₩1.53K' }, + { id: 'currencyIDR', decimals: 2, value: 1532.82, result: 'Rp1.53K' }, // Typical { id: 'ms', decimals: 4, value: 0.0024, result: '0.0024 ms' },