Calculating percent done for progress dialog

前端 未结 3 415
北恋
北恋 2021-01-22 12:39

I am trying to use a progress dialog to show how long until 2 time intensive functions are done.

in my first function I have the total number to db entries and a counter

3条回答
  •  广开言路
    2021-01-22 13:02

    You should either cast, or use the double type for counter and entries. I assume you're using ints currently, and as ints go, 3/36=0, and of course 0*100 is still 0.

提交回复
热议问题