I'm doing a project in which it calculates the characters with space and without space in RTF files.
After that the
Val(char without space is) / 65
--that is val of char divided by 65
But the problem is when i do the same calculation by getting the counts from msword and calculate it in windows calculator the result is different... i'm getting a small variation in result sometime in decimals maybe upto 1 value.
________________________________-
I declared all the variables in decimal.
__________________________________
This is the code i used for getting the counts!
___________________________________________________Code:Dim words() As String = rtf1.Text.Split(" ") Dim charsInc As Integer = rtf1.Text.Length Dim charsExc As Integer = rtf1.Text.Replace(" ", "").Length lblword.Text = words.Length & " words" lblchar.Text = charsInc & " characters including spaces" lblnochar.Text = charsExc & " characters excluding spaces" lblline.Text = rtf1.Lines.Length.ToString() & " lines"
Please help me out... is there anything else that is should know while working with division and decimals in VB?![]()




Reply With Quote