From ce29f3a14900b7ec3e4916af7956dfe5baf3aaf0 Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Sun, 15 Oct 2023 15:44:43 +0200 Subject: Calculating and displaying real prices --- src/time.odin | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/time.odin') diff --git a/src/time.odin b/src/time.odin index 90dca49..712136d 100644 --- a/src/time.odin +++ b/src/time.odin @@ -68,6 +68,7 @@ Workday :: struct { // timeblock's start and end fractions : [16]Fractionpair, total_timeblocks : int, + price: f32, } @@ -193,6 +194,7 @@ new_workday :: proc(previous_wrap : Moment, for each_block, i in blocks { fmt.printf("Block %2i: %s $f: %i%% %s\n", i+1, toString(each_block), int((each_block.value-1)*100), each_block.reason) + price += f32(f64(dayrate/7.5) * f64(hourcount(each_block)) * f64(each_block.value)) } return -- cgit v1.2.1