aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjloup <jloup@jloup.work>2018-05-22 13:37:38 +0200
committerjloup <jloup@jloup.work>2018-05-22 13:37:38 +0200
commitf7521f251456fea091d1eb950fd55a7cd4257c65 (patch)
tree2194f75d4f43c7fda691ca26c61b30ccd8a5da68
parent71e5314813f4b156809397a58304d43a47cf8357 (diff)
downloadFront-f7521f251456fea091d1eb950fd55a7cd4257c65.tar.gz
Front-f7521f251456fea091d1eb950fd55a7cd4257c65.tar.zst
Front-f7521f251456fea091d1eb950fd55a7cd4257c65.zip
Fix missing ticker.v0.0.20
-rw-r--r--api/portfolio.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/api/portfolio.go b/api/portfolio.go
index 1e16426..8e4cdc6 100644
--- a/api/portfolio.go
+++ b/api/portfolio.go
@@ -4,8 +4,8 @@ import (
4 "fmt" 4 "fmt"
5 "time" 5 "time"
6 6
7 "github.com/shopspring/decimal"
8 "git.immae.eu/Cryptoportfolio/Front.git/db" 7 "git.immae.eu/Cryptoportfolio/Front.git/db"
8 "github.com/shopspring/decimal"
9) 9)
10 10
11func init() { 11func init() {
@@ -27,6 +27,10 @@ type ValuePerformance struct {
27func NewValuePerformance(fromValue, toValue decimal.Decimal) ValuePerformance { 27func NewValuePerformance(fromValue, toValue decimal.Decimal) ValuePerformance {
28 variation := toValue.Sub(fromValue) 28 variation := toValue.Sub(fromValue)
29 29
30 if fromValue.Equals(decimal.Zero) {
31 return ValuePerformance{}
32 }
33
30 return ValuePerformance{ 34 return ValuePerformance{
31 Value: toValue, 35 Value: toValue,
32 Variation: variation, 36 Variation: variation,