"fmt"
"time"
+ "git.immae.eu/Cryptoportfolio/Front.git/db"
"github.com/shopspring/decimal"
- "immae.eu/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front/db"
)
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,