value property

num get value

Returns an integer if this number is whole, otherwise returns itself.

Example:

5.0.value; // 5
5.2.value; // 5.2

Implementation

num get value => this == round() ? round() : this;