Skip to content

Instantly share code, notes, and snippets.

@gerep
Created July 28, 2017 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerep/3162049db05dc07b027f3ec4adeebd18 to your computer and use it in GitHub Desktop.
Save gerep/3162049db05dc07b027f3ec4adeebd18 to your computer and use it in GitHub Desktop.
newPrice = fmt.Sprintf("%.2f", (current.Price*c.DiscountValue)/100)
current.NewPrice, err = strconv.ParseFloat(newPrice, 64)
if err != nil {
current.Message = "Ocorreu um erro ao calcular o novo valor deste produto: " + err.Error()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment