|  |  | | | Home » U++ Library support » LineEdit, EditFields, DocEdit » Please help debug this program (Re: EditDouble with customized Convert) Goto Forum:
	|  |  
	|  |  
	| 
		
			| Re: Please help debug this program (Re: EditDouble with customized Convert) [message #41321 is a reply to message #41313] | Sat, 30 November 2013 16:23   |  
			| 
				
				
					|  Lance Messages: 656
 Registered: March 2007
 | Contributor  |  |  |  
	| OK. I figured out. 
 The problem occurs because I SHOULD HAVE provided a matching filter to NOT TO replace comma with dot (the default behavior it inherits from its parent ConvertDouble), but should instead filter out it. Morale is, Scan/Format/Filter should work together to assure the EditField is in a consistent state.
 
 The second question, if you want to format a double to certain dicimal digits and with thousand separtor, you should:
 1. SetLangue properly;
 2. The format string should be something like this "%3!nl", which will format the number to 3 decimal points and with localized thousand separtors. Eg, in enUS, 12345.6 will be formatted to 12,345.600.
 
 I had to go through the code to figure it. Maybe a example line can be added to the Format example to save somebody else some trouble in the future.
 
 ===============================
 CORRECTION: the problem remains after a customized filter has been provided to take care of the comma separator. Now I am almost positive that it's a bug in the library.
 
 I have attached a slightly revised test case. Just drag the text between the edits a few times, you WILL observe erratic behavior.
 
	
	 Attachment: EditTest.zip (Size: 1.21KB, Downloaded 340 times)
 [Updated on: Sat, 30 November 2013 17:05] Report message to a moderator |  
	|  |  |  
	|  |  
	|  |  
	|  | 
 
 
 Current Time: Wed Oct 29 09:17:53 CET 2025 
 Total time taken to generate the page: 0.03370 seconds | 
 | 
 |