5
Contributors
7
Replies
33
Views
7 Years
Discussion Span
Last Post by samir_ibrahim
0

you provide the code but not the way I want. i want 10,000.00 not 10.000,00

this is your code :

Dim amount As Integer = CType(txtSehari.Text, Integer)

        txtSehari.Text = amount.ToString("##,##,###.00")
0

hmm how about this?

Dim floating As Double = 10761.937554
 TextBox1.Text = floating.ToString("N02")

seems more dynamic in case you have just 1000 or 1000000

0

I would use the format string "N2" as well but that will display 10,000.00 or 10.000,00 depending on your locale settings. I think you will have to follow adatapost's suggestion in order to display data in that format regardless of locale settings on the machine

0

yeah.. You right.. But i want to 10,000.00.. How can make it.. Not depending where i place.. Please.... I stuck ...

0

ok its might be not the sexiest solution ever but does the trick since we set the cultureinfo. so the users operating system should be irrelevant.

Dim floating As Double = 10761.937554
 TextBox1.Text =floating.ToString("C", New System.Globalization.CultureInfo("en-us")).Remove(0, 1)

.Remove(0, 1) removes just the dollar sign in front
prints: 10,761.94

0

yeah.. You right.. But i want to 10,000.00.. How can make it.. Not depending where i place.. Please.... I stuck ...

Unless I did not miss something, I found adatapost answer is what you want

Dim n As Integer = 12345
TextBox1.Text = n.ToString("###,###.00")
MsgBox("Next")
Dim d As Double = 123456.123
TextBox1.Text = d.ToString("###,###.00")
This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.