How can I round down a number in Javascript?

前端 未结 11 1396
感动是毒
感动是毒 2020-11-29 23:27

How can I round down a number in JavaScript?

math.round() doesn\'t work because it rounds it to the nearest decimal.

I\'m not sure if there is

11条回答
  •  臣服心动
    2020-11-29 23:53

    Here is math.floor being used in a simple example. This might help a new developer to get an idea how to use it in a function and what it does. Hope it helps!

    
    
    
    
        

    Let's add numbers

    +

    Enter the answer below and click 'Check'

    ***
    Total marks : 0

提交回复
热议问题