toBinary method
Transform string value to binary Example: 15 => 1111
Implementation
String? toBinary({bool nullOnError = false}) {
if (!NumUtils.isNum(this)) {
if (nullOnError) return null;
throw FormatException("Only accepting integer value");
}
return TransformUtils.toBinary(int.parse(this));
}