Untitled

mail@pastecode.io avatar
unknown
golang
2 months ago
519 B
4
Indexable
Never
if potongan != 0 {
		total = (float64(price) * float64(requestBody.TotalTicket)) + tax + platform_fee - (float64(potongan) * float64(requestBody.TotalTicket))
	} else if disconut != 0 {
		disc := ((float64(price) * float64(requestBody.TotalTicket)) + tax + platform_fee) * float64(disconut) / 100
		total = (float64(price) * float64(requestBody.TotalTicket)) + tax + platform_fee - (disc * float64(requestBody.TotalTicket))
	} else {
		total = (float64(price) * float64(requestBody.TotalTicket)) + tax + platform_fee
	}
Leave a Comment