I want to format a number, e.g. 279388242
.
Output: 2,793,882.42
How c开发者_如何学JAVAan I do this?
Try this:
Dim myNumber As Int = 279388242
Dim myNumberString As String = (myNumber * .01).ToString("N2") ' 2,793,882.42
I'm pretty sure there's a better way to do it, but that should get you going.
MsgBox(11.0F / 12.0F)
MsgBox(FormatNumber(10000000D, -1, TriState.True, TriState.UseDefault, TriState.True))
MsgBox(FormatCurrency(10000000I, -1, TriState.UseDefault, TriState.UseDefault, TriState.True))
Dim myNumber As Integer = 279388242
Dim myResult As String = FormatNumber(myNumber / 100, 2,,, TriState.True)
MsgBox(myResult)
精彩评论