From 2fc86566e8a3caee7e2df001c1baf73d86e0108e Mon Sep 17 00:00:00 2001 From: sartography-automated-committer Date: Mon, 4 Mar 2024 06:20:27 +0000 Subject: [PATCH] User: hurairaidrees@gmail.com clicked save for playground/nutech/receipt/receipt.bpmn --- playground/nutech/receipt/receipt.bpmn | 27 ++++++++------------------ 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/playground/nutech/receipt/receipt.bpmn b/playground/nutech/receipt/receipt.bpmn index ff87c8ea..1fa84a9d 100644 --- a/playground/nutech/receipt/receipt.bpmn +++ b/playground/nutech/receipt/receipt.bpmn @@ -127,36 +127,25 @@ minutes = 0 seconds = 0 days = 0 -# Extract the numeric part of the time value -numeric_part = "" -for char in timer_value_1: - if char.isdigit(): - numeric_part += char - else: - break - -# Add 'PT' to the numeric value -numeric_part_with_PT = 'PT' + numeric_part - # Populate values based on the selected time format if time_format == "Hour(s)": - hours = int(numeric_part) if numeric_part.isdigit() else 0 + hours = timer_value_1 elif time_format == "Minute(s)": - minutes = int(numeric_part) if numeric_part.isdigit() else 0 + minutes = timer_value_1 elif time_format == "Second(s)": - seconds = int(numeric_part) if numeric_part.isdigit() else 0 + seconds = timer_value_1 elif time_format == "Day(s)": - days = int(numeric_part) if numeric_part.isdigit() else 0 + days = timer_value_1 # Create ISO 8601 string representation based on the selected time format if time_format == "Hour(s)": - timer_value_1 = f"{str(numeric_part_with_PT)}H" + timer_value_1 = f"PT{hours}H" elif time_format == "Minute(s)": - timer_value_1 = f"{str(numeric_part_with_PT)}M" + timer_value_1 = f"PT{minutes}M" elif time_format == "Second(s)": - timer_value_1 = f"{str(numeric_part_with_PT)}S" + timer_value_1 = f"PT{seconds}S" elif time_format == "Day(s)": - timer_value_1 = f"{str(numeric_part_with_PT)}D" + timer_value_1 = f"P{days}D" # Now timer_value_tfc_str contains the ISO 8601 string representation based on the selected time format print(timer_value_1)