We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to select CHF currency in a column?

Thread ID:

Created:

Updated:

Platform:

Replies:

147456 Sep 11,2019 10:13 AM UTC Sep 12,2019 07:30 AM UTC Vue 1
loading
Tags: Data Grid
Roberto
Asked On September 11, 2019 10:13 AM UTC

Hi, I have something like this:

<e-column
              field="WE_SALDO"
              :format="{format:'C2', currency:'CHF'}"
              headerText="Saldo CHF"
            ></e-column>

but the showed symbol is still '$'.

How could I change this?

Thanks in advance

trap

Thavasianand Sankaranarayanan [Syncfusion]
Replied On September 12, 2019 07:30 AM UTC

Hi Roberto, 

Thanks for contacting us. 

To change currency code we need to refer the locale json files. After that we can change the currency code by using setCulture method. Please find the below code example and sample and documentation link  for more information. 

App.vue 
<template> 
  <div class="col-lg-12 control-section"> 
    <ejs-grid 
      ref="grid" 
      id="grid" 
      :dataSource="data" 
      :allowPaging="true" 
      :pageSettings="pageSettings" 
    > 
      <e-columns> 
        <e-column 
          field="OrderID" 
          headerText="Order ID" 
          width="120" 
          textAlign="Right" 
          :isPrimaryKey="true" 
        ></e-column> 
        <e-column 
          field="Freight" 
          headerText="Freight" 
          width="120" 
  :format="{format:'C2', currency:'CHF' }"           
textAlign="Right" 
          :isPrimaryKey="true" 
        ></e-column> 
        <e-column field="ShipCountry" headerText="Ship Country" width="150"></e-column> 
      </e-columns> 
    </ejs-grid> 
  </div> 
</template> 
<script> 
import Vue from "vue"; 
import { GridPlugin, Page } from "@syncfusion/ej2-vue-grids"; 
import { data } from "./data"; 
// refer the corresponding json files and load them using loadCldr method 
import { loadCldr, setCulture, setCurrencyCode } from "@syncfusion/ej2-base"; 
import * as currencies from "./currencies.json"; 
import * as gregorian from "./ca-gregorian.json"; 
import * as numbers from "./numbers.json"; 
loadCldr(currencies, gregorian, numbers); 
setCulture("sw"); 
setCurrencyCode("CHF"); 
Vue.use(GridPlugin); 

export default Vue.extend({ 
  data: () => { 
    return { 
      data: data.slice(0, 20), 
      pageSettings: { pageCount: 5 } 
    }; 
  }, 
  methods: {}, 
  computed: {}, 
  provide: { 
    grid: [Page] 
  } 
}); 
</script> 



Please get back to us, if you need further assitance. 

Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon