How to make thousand separator and decimals in textbox
I'd like to input numbers in a textbox and format it with a thousand separator and two decimals.<br /> <br /> I've tried the Masked Edit with a lot of different masks, but I just can't get it to work. <br /> <br /><div> And I tried this code: </div><div> <div class="dp-highlighter"><ol start="1" class="dp-c"><li class="alt"><span><span>Thread.CurrentThread.CurrentCulture = </span><span class="keyword">new</span><span> CultureInfo(</span><span class="string">"fr-FR"</span><span>); </span></span></li><li class=""><span> </span></li><li class="alt"><span> </span></li><li class=""><span> <span class="keyword">double</span><span> text = </span><span class="keyword">double</span><span>.Parse(txt.Text); </span></span></li><li class="alt"><span> txt.Text = text.ToString(<span class="string">"#,##"</span><span>); <br /></span></span></li></ol></div></div><div> But when I insert in the textbox for example 2500 I got 02 500 while I want 2 500.<br /> Any suggestions ? <br /> Thank you.</div><div><br /> </div>