RealGrid2 API
Interface
Realgridlocale

RealGridLocale

그리드가 참조하기 위한 locale과 currency를 설정한다.

numberFormats: Intl.NumberFormat (opens in a new tab)을 이용한 numberFormat을 등록한다.

messages: 그리드의 메시지를 사용자 환경에 맞게 변경한다.

Signature:

export interface RealGridLocale 

Remarks

화폐를 표시하기 위해서는 currency를 지정해야 한다.

Properties

PropertyModifiersTypeDescription
currencystring사용할 통화코드를 지정한다
localestring언어 또는 언어-지역형태로 지정한다.
messagesRealGridMessages그리드에 표시되는 메시지를 지정한다.
numberFormats{ [name: string]: NumberFormatOptions; }컬럼에서 사용할 numberFormat을 등록한다. locale에 따라 천단위 구분기호와 소숫점 기호가 변경된다.

Properties Desc

currency

사용할 통화코드를 지정한다

Remarks:

KRW, USD등으로 지정한다.

locale

언어 또는 언어-지역형태로 지정한다.

messages

그리드에 표시되는 메시지를 지정한다.

numberFormats

컬럼에서 사용할 numberFormat을 등록한다. locale에 따라 천단위 구분기호와 소숫점 기호가 변경된다.

Remarks:

Intl.NumberFormat (opens in a new tab) 을 이용해서 화면에 출력될 문자열을 만든다.

Example:

RealGrid.setLocale({
  locale: "ko",
  currency: "KRW",
  numberFormats: {
    "number2": {                // `number2`는 컬럼의 numberFormat으로 설정한다.
      style: "decimal",         // 숫자 형식
      minimumFractionDigits: 2, // 최소 소수점 2자리까지 출력. default: 0
      maximumFractionDigits: 2, // 최대 소수점 2자리까지 출력. default: 3
      excelFormat: "_-#,##0.0?_ ;-#,##0.0?_ " // 엑셀로 출력될때사용되는 서식
    },
    "USD": {
      style: "currency",           // 화폐형식 format 지정된 currency에 따른 화폐기호를 자동으로 붙여준다.
      currency: "USD",             // 화폐단위
      excelFormat: '"US$"#,##0.00' // 엑셀로 출력될때 사용되는 서식
    }
  }
});
 
const columns = [
  { name: "importPrice", fieldName: "importPrice", numberFormat: "USD"}
]