Convert double to Int, rounded down

前端 未结 5 1949
猫巷女王i
猫巷女王i 2020-12-15 02:27

How to convert a double value to int doing the following:

Double If x = 4.97542. Convert to int x = 4.

Double If x = 4.23544. Conv         


        
5条回答
  •  不知归路
    2020-12-15 03:09

    Another option either using Double or double is use Double.valueOf(double d).intValue();. Simple and clean

提交回复
热议问题