How to split Double value in dart?

2019-07-25 18:21发布

问题:

I want to assign two variables to integer and decimal parts on double. how to do it?

回答1:

One way would be

int x = abc.toInt()
int y = int.tryParse(abc.toString().split('.')[1]);


标签: dart flutter