TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jim Tat
NA
52
47.2k
How to make thousand separator and decimals in textbox
Sep 27 2016 7:41 AM
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>
Reply
Answers (
11
)
In .net Property of get/set how to call inside function
How to insert certain numbers in a Text boxes ?