PureScript – Convert a number to an integer?

If it’s not already an integer, there is no one true way of converting it to an integer. You could round to the nearest integer, round up, round down, do banker’s rounding, or some sort of crazy conversion scheme of your own.

The Data.Int module offers several functions for different conversion strategies, such as floor, ceil, and round.

Leave a Comment