So I'm trying to split two variables that Actually I am trying to remove the percentage of the completion of my file upload and according to the progress bar I am updating. For example, I am sending 262144 to 1821948 bytes But when I do Thank you! If you are dividing an integer, the result is going to double, but it's too late It's gone: You've already lost the precision. If you repeat one of the two operators, one will be encouraged to double the other and you will get a floating point value as a result: has long been , < Code> totalBytesWritten and
totalBytesExpected
double progress = estimated total bytes / total bytes approximate then gives me some unexpected number When I progress to NSLog I get only 0s and finally 1.
NSLog (@ "% F, "(double) total bits written / total bytes expected);
No comments:
Post a Comment