/* Quantity. */
echo "<tr>\n";
echo " <td>Quantity (kg)</td>\n";
- echo " <td>"; input("quantity", $donation->getQuantity()); echo "</td>\n";
+ echo " <td>"; input("quantity", sprintf("%0.2f", $donation->getQuantity() / 1000)); echo "</td>\n";
echo "</tr>\n";
}
$donation->setDate($date);
$donation->setContactId($contact_id);
$donation->setHubId($hub_id);
- $donation->setQuantity($quantity);
+ $donation->setQuantity($quantity * 1000);
try {
$donation->save();
}
function get_donation_displayname($donation) {
- return $donation->getQuantity() . "kg on " . $donation->getDate();
+ return sprintf("%0.2fkg on %s", $donation->getQuantity() / 1000, $donation->getDate());
}
function get_order_displayname($order) {
- return $order->getQuantity() . "kg on " . $order->getDate();
+ return sprintf("%0.2fkg on %s", $order->getQuantity() / 1000, $order->getDate());
}
function get_address_area($address) {
/* Quantity. */
echo "<tr>\n";
echo " <td>Quantity (kg)</td>\n";
- echo " <td>"; input("quantity", $order->getQuantity()); echo "</td>\n";
+ echo " <td>"; input("quantity", sprintf("%0.2f", $order->getQuantity() / 1000)); echo "</td>\n";
echo "</tr>\n";
/* Driver. */
$order->setRequesterId($requester_id);
$order->setBeneficiaryId($beneficiary_id);
$order->setHubId($hub_id);
- $order->setQuantity($quantity);
+ $order->setQuantity($quantity * 1000);
/* XXX: begin/commit */
try {