Skip to content

Commit

Permalink
colocando as coisas em seus devidos lugares
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottainfo committed Dec 25, 2023
1 parent 45e699c commit ed4e186
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions cli/pkg/handler/calculation_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@ package handler

import (
"profitability/cli/pkg/calculus"
"profitability/cli/pkg/util"
"profitability/cli/pkg/display"
)

func HandleProp(taxa float64) {
result, err := calculus.Prop(taxa)
util.ErrorHandler(err)
ErrorHandler(err)
display.ShowPropResult(result)
}

func HandlePre(taxa float64, prazo int) {
result, err := calculus.Pre(taxa, prazo)
util.ErrorHandler(err)
ErrorHandler(err)
display.ShowPreResult(result)
}

func HandlePos(taxa float64, prazo int) {
result, err := calculus.Pos(taxa, prazo)
util.ErrorHandler(err)
ErrorHandler(err)
display.ShowPosResult(result)
}

func HandleIPCA(taxa float64, prazo int) {
result, err := calculus.IPCA(taxa, prazo)
util.ErrorHandler(err)
ErrorHandler(err)
display.ShowIPCAResult(result)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package handler

import (
"fmt"
Expand Down
4 changes: 2 additions & 2 deletions cli/pkg/handler/parameter_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ func HandleModal(modalidade string) {

func HandleTaxa(taxaStr string) (float64) {
taxa, err := util.IsValidTaxa(taxaStr)
util.ErrorHandler(err)
ErrorHandler(err)
return taxa
}

func HandlePrazo(prazoStr string) (int) {
prazo, err := util.IsValidPrazo(prazoStr)
util.ErrorHandler(err)
ErrorHandler(err)
return prazo
}

Expand Down

0 comments on commit ed4e186

Please sign in to comment.