Closed ferraridamiano closed 2 years ago
Developer that need to convert just one unit to another needs to write a little bit of boilerplate code:
var length = Length()..convert(LENGTH.meters, 1); // We give 1 meter as input var unit = length.inches; // We get the inches
If we implement num extension we would get something much simpler:
1.convertFromTo(LENGTH.meters, LENGTH.inches)
This should be just an addition to the current API, not a replacement!
Developer that need to convert just one unit to another needs to write a little bit of boilerplate code:
If we implement num extension we would get something much simpler:
This should be just an addition to the current API, not a replacement!