How to use the angular-l10n.L10nDecimalPipe function in angular-l10n

To help you get started, we’ve selected a few angular-l10n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipsesource / jsonforms / packages / ionic / src / controls / number / number-control.ts View on Github external
mapAdditionalProps(props: ControlProps) {
    if (!isEmpty(props.schema)) {
      // TODO
      const defaultStep = isNumberControl(this.uischema, this.schema) ? 0.1 : 1;
      this.min = props.schema.minimum;
      this.max = props.schema.maximum;
      this.step = props.schema.multipleOf || defaultStep;
      // this doesn't seem to work reliably; an entered value will be formatted
      // the 1st time when blurring out, but it doesn't work the 2nd time
      // although the internal state seems correct
      this.locale = getLocale(this.ngRedux.getState());
      const pipe = new L10nDecimalPipe(this.localeService);
      this.localeService.setDefaultLocale(this.locale);
      if (this.locale) {
        this.displayValue = pipe.transform(props.data, this.locale);
      } else {
        this.displayValue = props.data;
      }
    }
  }
}