From d7b4c382cd5fa3daf94cfb320d8b1c84f329046c Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 18 Dec 2024 18:10:52 +0100 Subject: [PATCH] =?UTF-8?q?fix(StringExtensions):=20Die=20Hauptformel=20de?= =?UTF-8?q?r=20ToTag-Methode=20wurde=20von=20(x=20/=20y)=20in=20[(x=20-=20?= =?UTF-8?q?1)=20/=20y=20+=201]=20ge=C3=A4ndert,=20um=20korrekt=20zu=20grup?= =?UTF-8?q?pieren.=20=20-=20Aktualisierte=20Dokumentationskommentare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/AsymCryptParams.cs | 8 ++++---- .../Config/StringExtensions.cs | 19 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/DigitalData.Core.Security/Config/AsymCryptParams.cs b/DigitalData.Core.Security/Config/AsymCryptParams.cs index c4ef697..7547f50 100644 --- a/DigitalData.Core.Security/Config/AsymCryptParams.cs +++ b/DigitalData.Core.Security/Config/AsymCryptParams.cs @@ -41,11 +41,11 @@ namespace DigitalData.Core.Security.Config ///
/// - is used when converting to tag. ///
- /// - If the format contains the "//" symbol, the method divides the numeric value derived from the left side of the format - /// by the numeric value of the right side of the format string. For instance: + /// - If the format contains the symbol “//”, the method divides the numeric value obtained from the left side of the format + /// by one minus the numeric value obtained from the right side of the format string and adds one. For instance: ///
- /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), divides it by 2 (resulting in 1), - /// and returns "1". + /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), subtracts one (3), divides it by 2, + /// rounds down the outgoing number (1), adds one to the number (resulting in 2). ///
/// - If the format does not contain "//", the method uses the default format. ///
diff --git a/DigitalData.Core.Security/Config/StringExtensions.cs b/DigitalData.Core.Security/Config/StringExtensions.cs index 379af2e..889075f 100644 --- a/DigitalData.Core.Security/Config/StringExtensions.cs +++ b/DigitalData.Core.Security/Config/StringExtensions.cs @@ -13,15 +13,14 @@ /// /// Converts a to a formatted string based on the specified format string. ///
- /// - If the format contains the "//" symbol, the method divides the numeric value derived from the left side of the format - /// by the numeric value of the right side of the format string. For instance: + /// - If the format contains the symbol “//”, the method divides the numeric value obtained from the left side of the format + /// by one minus the numeric value obtained from the right side of the format string and adds one. For instance: ///
- /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), divides it by 2 (resulting in 1), - /// and returns "1". + /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), subtracts one (3), divides it by 2, + /// rounds down the outgoing number (1), adds one to the number (resulting in 2). ///
/// - If the format does not contain "//", the method uses the default format. ///
- /// This method provides a way to format the date based on typical or customized rules, including mathematical operations like division. ///
/// The value to be formatted. /// The format string that dictates the formatting of the date. If the format includes the "//" symbol, @@ -51,7 +50,7 @@ if (mode == 0) throw new DivideByZeroException("Division by zero is not allowed."); - var result = dateValue / mode; + var result = (dateValue - 1) / mode + 1; return result.ToString(); } @@ -61,11 +60,11 @@ /// /// Converts a to a formatted string based on the specified format string. ///
- /// - If the format contains the "//" symbol, the method divides the numeric value derived from the left side of the format - /// by the numeric value of the right side of the format string. For instance: + /// - If the format contains the symbol “//”, the method divides the numeric value obtained from the left side of the format + /// by one minus the numeric value obtained from the right side of the format string and adds one. For instance: ///
- /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), divides it by 2 (resulting in 1), - /// and returns "1". + /// - If the date is 02.03.2024 and the format is "MM//2", it extracts the month (02), subtracts one (3), divides it by 2, + /// rounds down the outgoing number (1), adds one to the number (resulting in 2). ///
/// - If the format does not contain "//", the method uses the default format. ///