为什么Math.floor会返回零?

elv*_*s17 0 javascript math

我想问一下为什么Math.floor方法返回零.这是我的代码:

var duration = 217;

var sec = Math.floor((duration / 1000) % 60);
var min = Math.floor((duration / (60 * 1000)) % 60);
Run Code Online (Sandbox Code Playgroud)

那有什么不对?

Jér*_*ôme 6

var sec = Math.floor((duration / 1000) % 60);
Run Code Online (Sandbox Code Playgroud)

(217/1000)%60 = 0.217

最低值0.217为0.