Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » what about decimal-point and thousand-separator? 
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: what about decimal-point and thousand-separator? [message #5390 is a reply to message #5388] | 
			Mon, 18 September 2006 12:58    | 
		 
		
			
				
				
				  | 
					
						  
						mirek
						 Messages: 14271 Registered: November 2005 
						
					 | 
					Ultimate Member  | 
					 | 
		 
		 
	 | 
 
	
		| nicomesas wrote on Mon, 18 September 2006 06:37 |   Hey! 
 
At the moment I am testing the system that has U++ to convert the numbers into strings and it disappoints to me that he is not able to use parameters of the language to establish the point decimal and the  thousands separator. Or I am not at least able to find how one becomes.  
 
I have found in Core/Lang.cpp that the code tries to load these data of the system, and also are in the class 'LanguageInfo' but unfortunately, they are not being used in any of the functions of type 'AsString' or 'FormatDouble...' that I have found in Core/Format.cpp 
 
This is specially annoying for the data that contain money, since I don't like to see in my language typical expression "1.000,50¤" this is in the USA and others paises but in Spain and many others would be "1.000,50¤"  
 
I will have to write my own functions to do this? 
 
Nico
  |  
  
 
Well, these things are still debated. Anyway, in any case I believe that FormatDouble or AsString should yield always the same result, regardless of language settings. 
 
In this moment, the right way how to do this is to use LanguageInfo. There is 
 
const LanguageInfo&       GetLanguageInfo(); 
 
that returns current system default info; use 
 
virtual String  FormatDouble(double value, int digits, int FD_flags = 0, int fill_exp = 0) const; 
 
from its interface. (GetLanguageInfo().FormatDouble()). 
 
Be however warned that some changes here are still possible. 
 
Alternative path is to use "nl" or "vl" in Format. 
 
http://upp.sourceforge.net/src$Core$Format$en-us.html 
 
"nl"/"vl" are better as they will not change in future. 
 
Mirek 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 15:48:56 CET 2025 
 Total time taken to generate the page: 0.06215 seconds 
 |