Decimal placement more than 3 digits?
Hello, I am making this application and I need the decimal placement to go past 3 digits after the decimal is placed. I would do double but that seems to mess the program up with unwanted digits. I am different radio button options like tenths place, hundreths place, etc... all the way to millionths. It will go to thousandths and that is where it is lastly effective before it can not go up anymore numbers anymore. Replies are appreciated, thanks!
Re: Decimal placement more than 3 digits?
try
format(txtdata.text,"0##.00")
for reference if it is useful
Re: Decimal placement more than 3 digits?
Quote:
Hello, I am making this application and I need the decimal placement to go past 3 digits after the decimal is placed.
You question is pretty unclear, so I reckon that you just need proper format for your numbers:
Code:
Dim value As Integer = 1234567891
MsgBox(value.ToString("N0") 'zero and not "O" character
'Result is 1.234.567.891
'Or Msgbox(value.ToString("N3")) - result is 1.234.567.891,000
You can use Double too. And you might a look at this for future formats:
https://msdn.microsoft.com/en-us/lib...code-snippet-1
Re: Decimal placement more than 3 digits?
1) yes, don't use the double... use the Decimal type...
2) Don't confuse the value with the display...
3) since you haven't shown any code, I'm not sure what the issue is... so, refer back to item 1 in this list.
-tg
Re: Decimal placement more than 3 digits?
Alright, somewhat what I want. It stops at 0.001 but I need it to go as far as 0.00001
Re: Decimal placement more than 3 digits?
What do you meant "Stops"? Keep in mind, we haven't the foggiest idea what you're doing since you haven't shown what code you're using.
-tg
Re: Decimal placement more than 3 digits?
What I mean is this: I have 6 Options. Tenths, Hundredths, Thousandths, Ten-Hundredths, Ten-Thousandths, and Millionths. The format for Thousandths is 0.001 and when I try millionths it should be 0.000001 but the displayed format is 0.001
Here is some code:
Code:
Sub Millionths()
startNum = txtStart.Text
EndNum = txtEnd.Text
While (startNum >= EndNum + 0.000001)
counter += 1
startNum -= 0.001
Data += startNum & vbNewLine
End While
starting = txtStart.Text
rtbDisplay.Text = starting & vbNewLine & Data & vbNewLine
lblCount.Text = counter
End Sub
Declares(At start of program):
Code:
Dim startNum, starting As Decimal
Dim EndNum As Decimal
Dim Data As String
Dim counter As Integer = 0
Re: Decimal placement more than 3 digits?
You already have all the information you need from post #3. Did you follow the link provided there?
Re: Decimal placement more than 3 digits?
Oh I didn't even notice that link lol, I will look at in a bit. Thanks for pointing that out!