From 7d7f289200a8c73e7ba1ab0a4cc6f39e8c60b852 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期六, 10 五月 2025 11:22:18 +0800 Subject: [PATCH] 优化测试 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 0efbe39..b968cb5 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -2113,6 +2113,15 @@ return true; return false; } + + /// <summary> + /// + /// </summary> + /// <param name="box1">txt_psnQty_1:姣忓紶鏉$爜鏁伴噺</param> + /// <param name="box2">txt_iCount_1:鏁村紶鏁板��</param> + /// <param name="sum">txt_kQty:鍙墦鍗伴噺</param> + /// <param name="rd"></param> + /// <param name="txt_yuliang">txt_yuliang:浣欓噺</param> public static void PrintJiSuan(DevExpress.XtraEditors.TextEdit box1, DevExpress.XtraEditors.TextEdit box2, string sum, DevExpress.XtraEditors.RadioGroup rd, DevExpress.XtraEditors.TextEdit txt_yuliang = null) { if (rd.SelectedIndex == 2) @@ -2129,11 +2138,16 @@ decimal? dc1 = Gs.DevApp.ToolBox.UtilityHelper.GetDecimal(t1); decimal dividend = decimal.Parse(sum); // 琚櫎鏁� decimal divisor = decimal.Parse(t1); // 闄ゆ暟 - decimal quotient = dividend / divisor; // 鏁存暟閮ㄥ垎 - decimal remainder = dividend % divisor; // 浣欐暟 - box2.Text = quotient.ToString(); + decimal shang = dividend / divisor; + + decimal integerPart = Math.Truncate(shang); // 鑾峰彇鏁存暟閮ㄥ垎 + decimal decimalPart = dividend - divisor* integerPart; // 鑾峰彇灏忔暟閮ㄥ垎 + + //decimal quotient = dividend / divisor; // 鏁存暟閮ㄥ垎 + //decimal remainder = dividend % divisor; // 浣欐暟 + box2.Text = integerPart.ToString(); if (rd.SelectedIndex == 0) - txt_yuliang.Text = remainder.ToString(); + txt_yuliang.Text = decimalPart.ToString(); } catch (Exception ex) { -- Gitblit v1.9.3