Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Avg ¶
Example ¶
payments := []types.Payment{
{
ID: 1,
Amount: 10_00,
Category: "qr",
},
{
ID: 2,
Amount: 150_00,
Category: "qr",
},
{
ID: 3,
Amount: 110_00,
Category: "shop",
},
}
fmt.Println(Avg(payments))
Output: 9000
func TotalInCategory ¶
Example ¶
payments := []types.Payment{
{
ID: 1,
Amount: 10_00,
Category: "qr",
},
{
ID: 2,
Amount: 150_00,
Category: "qr",
},
{
ID: 3,
Amount: 110_00,
Category: "shop",
},
}
fmt.Println(TotalInCategory(payments, "qr"))
Output: 16000
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.