Separating double into integer and decimal parts

前端 未结 11 1056
日久生厌
日久生厌 2020-12-06 10:20

I am trying to separate a double into the integer and decimal parts

So for example, the number 24.4 should be separated into 24 and 4.

int integer =          


        
11条回答
  •  -上瘾入骨i
    2020-12-06 10:54

    You could do a String split(...). And then Integer parseInt(...) to get back the two integer components.

提交回复
热议问题