convert method
Implementation
double convert(
int value,
TypeDataConvert typeFrom,
TypeDataConvert typeTo,
) {
if (typeFrom == TypeDataConvert.byte) {
if (typeTo == TypeDataConvert.gigaByte) {
return value / gbConstant;
} else if (typeTo == TypeDataConvert.megaByte) {
return value / mbConstant;
} else if (typeTo == TypeDataConvert.kiloByte) {
return value / kbConstant;
} else {
return value * bitConstant;
}
} else {
return value.toDouble();
}
}