Change format number

Hi, I want to format number 1,213,123.32 to 1.213.123,32. Can you help me?



3 Replies

BC Berly Christopher Syncfusion Team December 15, 2021 04:17 PM UTC

Hi Toan Bui, 
  
Greetings from Syncfusion support. 
  
We can achieve the requested requirement by loading the German (“de”) culture to the numeric textbox component which help you to render the decimal separator as “,” and group separator as “.”. Please refer the below documentation to load the required culture to the component. 
  
  
  
Regards, 
Berly B.C 



TB Toan Bui January 5, 2022 10:41 AM UTC

Hi, I try to set culture for enumeric but it's not work. Can you help me?



DA Dineshkumar Arumugam Syncfusion Team January 6, 2022 07:28 PM UTC


Hi Toan Bui,  
   
We have prepared a sample to meet your requirement, please refer the below code snippet and sample to get rid of the issue, also please refer the below documentation to load the required culture to the component.  
 
[App.compoent.ts] 
 
import { Component } from '@angular/core'; 
import { loadCldr, L10n } from '@syncfusion/ej2-base'; 
import * as numberingSystems from '../assets/numberingSystems.json'; 
import * as numbers from '../assets/numbers.json'; 
import * as currencyData from '../assets/currencyData.json'; 
import * as currencies from '../assets/currencies.json'; 
 
loadCldr(numberingSystems, numbers, currencyData, currencies); 
 
@Component({ 
  selector: 'app-root', 
  template: `<ejs-numerictextbox locale='de' currency='EUR' format='c2' value='1000'></ejs-numerictextbox>`, 
  styleUrls: ['./app.component.css'] 
}) 
export class AppComponent { 
  ngOnInit(): void { 
 
    L10n.load({ 
      'de': { 
        'numerictextbox': { 
                incrementTitle: 'Wert erhöhen', decrementTitle: 'Dekrementwert' 
            } 
          }   
    }); 
   
  }    
} 
 
 
 
   


Please get back to us, if you need any further assistance. 


Regards, 
Dineshkumar A. 


Loader.
Up arrow icon