Campbell Ritchie wrote:Please explain why that won't work. And it is unnecessarily complicated.
Rudradutt Joshi wrote: . . . I had just provided a work around for calculating correct percentage to enable below code in correct manner.
. . .
I preferred Michael Duff's solution. I have a solution of my own, where I multiplied the count by 100 and 1000 and divided twice to get % and 0.1% values. Do you really want the length of the string as the denominator of the division?
returns integer. And will result in 0 in general cases.
(((Integer) letterCount.elementAt(ch)) / textLength)
Campbell Ritchie wrote:Nonsense. It's an int. that is about the one bit that is correct. A double can introduce imprecision, and cause the loop to malfunction.
rudradutt joshi wrote: . . . for correct results you should use double as holder of length.
to double is increase precision.
((Integer) letterCount.elementAt(ch)) / textLength)
Because the handling of sockets on different platforms can differ significantly, the FTPClient automatically issues a new PORT command prior to every transfer requiring that the server connect to the client's data port.
(i.e. whatever /,\,//,$,,:| )