From b6dab385dbf9a626970f3673d345d0e8e6a62e1e Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Thu, 5 Oct 2023 21:53:07 +0200 Subject: Rudimentary display of actual results --- src/main.odin | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main.odin') diff --git a/src/main.odin b/src/main.odin index 7884f28..8199e65 100644 --- a/src/main.odin +++ b/src/main.odin @@ -13,8 +13,10 @@ main :: proc() { // for cache reasons, and to simplify the process of // adding new Workdays to the array. + dayrate : f64 = 3500 workdays : [dynamic]Workday //resize(&workdays, 3) + the_big_sum : f64 = 0 { // No need to keep this array in memory forever c, _ := importICS("res/test.ics") @@ -25,9 +27,13 @@ main :: proc() { thing.start, thing.end, thing.end)) + for each_block in workdays[i].blocks { + the_big_sum += f64(each_block.value) * (dayrate/7.5) * f64(hourcount(each_block)) + } } } + //if true do return /*workday0: = new_workday({10, 22, 3, 5, 2023}, @@ -64,8 +70,13 @@ main :: proc() { defer delete(date_text) wrap_text[len(wrap_text)-1] = 0 - total_sum: cstring = "3500 NOK + 26%" - inc_soc: cstring = "4276 NOK" + + total_sum: cstring = f64_to_cstring(the_big_sum) + defer delete(total_sum) + + inc_soc: cstring = f64_to_cstring(the_big_sum*1.26) + defer delete(inc_soc) + text_height: f32 -- cgit v1.2.1