diff --git a/postgres/numeric.go b/postgres/numeric.go index acf5f03..82c09a8 100644 --- a/postgres/numeric.go +++ b/postgres/numeric.go @@ -19,3 +19,8 @@ func (n Numeric) GetPositive() bool { float := n.GetFloat64() return float >= 0 } + +func (n Numeric) IsZero() bool { + float := n.GetFloat64() + return float == 0 +} diff --git a/web/amount.tpl b/web/amount.tpl index 1f6a9c6..fd68a36 100644 --- a/web/amount.tpl +++ b/web/amount.tpl @@ -1,11 +1,11 @@ {{define "amount"}} - + {{printf "%.2f" .GetFloat64}} {{end}} {{define "amount-cell"}} -