141 else |
141 else |
142 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(QString(""))); |
142 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(QString(""))); |
143 |
143 |
144 w = QString(""); |
144 w = QString(""); |
145 if (query.value("inventory").toDouble() > 0) { |
145 if (query.value("inventory").toDouble() > 0) { |
146 if (query.value("form").toInt() < HOP_FORMS_CO2EXTRACT) { |
146 if (query.value("inventory").toDouble() < 1.000) { |
147 if (query.value("inventory").toDouble() < 1.000) { |
147 w = QString("%1 gr").arg(query.value("inventory").toDouble() * 1000.0, 2, 'f', 1, '0' ); |
148 w = QString("%1 gr").arg(query.value("inventory").toDouble() * 1000.0, 2, 'f', 1, '0' ); |
|
149 } else { |
|
150 w = QString("%1 kg").arg(query.value("inventory").toDouble(), 4, 'f', 3, '0' ); |
|
151 } |
|
152 } else { |
148 } else { |
153 if (query.value("inventory").toDouble() < 1.000) { |
149 w = QString("%1 kg").arg(query.value("inventory").toDouble(), 4, 'f', 3, '0' ); |
154 w = QString("%1 mL").arg(query.value("inventory").toDouble() * 1000.0, 2, 'f', 1, '0' ); |
|
155 } else { |
|
156 w = QString("%1 L").arg(query.value("inventory").toDouble(), 4, 'f', 3, '0' ); |
|
157 } |
|
158 } |
150 } |
159 } |
151 } |
160 item = new QTableWidgetItem(w); |
152 item = new QTableWidgetItem(w); |
161 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
153 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
162 this->tableHops->setItem(ridx, 9, item); |
154 this->tableHops->setItem(ridx, 9, item); |