/*
* Converting units
*/
UnitGroup group = UnitGroup.GROUPS[unitGroups.getSelectedIndex()];
Unit[] units = group.units;
Unit unitFrom = group.units[this.unitFrom.getSelectedIndex()];
Unit unitTo = group.units[this.unitTo.getSelectedIndex()];
double quantityFrom =
Double.parseDouble(numberBox.getString());
double quantityTo = round(Unit.convert(quantityFrom, unitFrom, unitTo));