Skip to content

Commit

Permalink
parse amount with comma
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyYe committed Jan 7, 2019
1 parent 5b3f129 commit 8b7f13c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/er/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func parseArgs(args []string) (string, float32, []string) {

if len(args) >= 3 {
from = args[1]
s, err := strconv.ParseFloat(args[2], 32)
amountArg := strings.Replace(args[2], ",", "", -1)
s, err := strconv.ParseFloat(amountArg, 32)
if err != nil {
fmt.Println("Please input valid amount")
}
Expand Down

0 comments on commit 8b7f13c

Please sign in to comment.