Support decimal currency amounts (#74)
Reviewed-on: #74
This commit was merged in pull request #74.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user