mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
use String(max_len) for DECIMAL types with sqlite
This solves an issue where DECIMAL is not native to sqlite by using a string to store values and converting them to float in user code. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
a65a60604a
commit
e5df083d45
2 changed files with 13 additions and 4 deletions
|
@ -67,8 +67,11 @@ if (has_credential(CRED_TU_ADD_VOTE)) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST['addVote']) && empty($error)) {
|
||||
add_tu_proposal($_POST['agenda'], $_POST['user'], $len, $quorum, $uid);
|
||||
if (!empty($_POST['addVote']) && empty($error)) {
|
||||
// Convert $quorum to a String of maximum length "12.34" (5).
|
||||
$quorum_str = substr(strval($quorum), min(5, strlen($quorum));
|
||||
add_tu_proposal($_POST['agenda'], $_POST['user'],
|
||||
$len, $quorum_str, $uid);
|
||||
|
||||
print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n";
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue