import { KBN_FIELD_TYPES } from '@kbn/field-types' ; import { FieldFormat } from '../../../src/plugins/field_formats/common' ; export class ExampleCurrencyFormat extends FieldFormat { static id = 'example-currency' ; static title = 'Currency (example)' ; static fieldType = KBN_FIELD_TYPES . NUMBER ; getParamDefaults ( ) { return { currency : 'EUR' , } ; } textConvert = ( val ) => { if ( typeof val !== 'number' ) return `${ val }` ; return new Intl . NumberFormat ( undefined , { style : 'currency' , currency : this . param ( 'currency' ) , } ) . format ( val ) ; } ; }