"fmt"
"time"
- "github.com/shopspring/decimal"
"git.immae.eu/Cryptoportfolio/Front.git/db"
+ "github.com/shopspring/decimal"
)
func init() {
func NewValuePerformance(fromValue, toValue decimal.Decimal) ValuePerformance {
variation := toValue.Sub(fromValue)
+ if fromValue.Equals(decimal.Zero) {
+ return ValuePerformance{}
+ }
+
return ValuePerformance{
Value: toValue,
Variation: variation,