m3_lightmeter/lib/utils/to_string_signed.dart
Vadim 130f5ff0b2
ML-14 Implement EV calibration legacy feature (#15)
* wip

* implemented `CalibrationDialog`

* integrated calibration to the metering bloc

* checked legacy feature
2023-01-26 12:10:23 +03:00

19 lines
395 B
Dart

extension SignedString on num {
String toStringSigned() {
if (this > 0) {
return "+${toString()}";
} else {
return toString();
}
}
}
extension SignedStringDouble on double {
String toStringSignedAsFixed(fractionDigits) {
if (this > 0) {
return "+${toStringAsFixed(fractionDigits)}";
} else {
return toStringAsFixed(fractionDigits);
}
}
}