Support decimal currency amounts (#74)

Reviewed-on: #74
This commit was merged in pull request #74.
This commit is contained in:
2025-05-24 06:28:07 +02:00
parent 426e456ba7
commit f8d1f195de
4 changed files with 57 additions and 35 deletions

View File

@@ -49,7 +49,7 @@ func renderCreateTask(c *gin.Context) {
name := c.PostForm("name")
rewardStr := c.PostForm("reward")
reward, err := strconv.Atoi(rewardStr)
reward, err := strconv.ParseFloat(rewardStr, 64)
if err != nil {
renderError(c, http.StatusBadRequest, err)
return
@@ -96,7 +96,7 @@ func renderCreateAllowance(c *gin.Context) {
name := c.PostForm("name")
targetStr := c.PostForm("target")
target, err := strconv.Atoi(targetStr)
target, err := strconv.ParseFloat(targetStr, 64)
if err != nil {
renderError(c, http.StatusBadRequest, err)
return