From 2051c65ce32f49308364273c87c3d58acea5ef4e Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 17:53:35 +0800 Subject: [PATCH] 1 --- .../BookingOrder/BookingOrderService.cs | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f7c9cd3a..731cd0a3 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2711,17 +2711,15 @@ namespace Myshipping.Application { var value = string.Empty; if (order.PKGS!=null) { - if (Convert.ToInt32(order.PKGS.ToString().Split('.')[1]) == 0) { - value = order.PKGS.ToString().Split('.')[0]; + if (order.PKGS.ToString().Split('.').Count() > 1) + { + value = string.Format("{0:F2}", order.PKGS); } else { - value = string.Format("{0:F2}", order.PKGS); - + value = order.PKGS.ToString().Split('.')[0]; } + } - - - ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { @@ -2739,15 +2737,15 @@ namespace Myshipping.Application var value = string.Empty; if (order.KGS != null) { - if (Convert.ToInt32(order.KGS.ToString().Split('.')[1]) == 0) + if (order.KGS.ToString().Split('.').Count() > 1) { - value = order.KGS.ToString().Split('.')[0]; + value = string.Format("{0:F2}", order.KGS); } else { - value = string.Format("{0:F2}", order.KGS); - + value = order.KGS.ToString().Split('.')[0]; } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null) @@ -2767,15 +2765,15 @@ namespace Myshipping.Application var value = string.Empty; if (order.CBM != null) { - if (Convert.ToInt32(order.CBM.ToString().Split('.')[1]) == 0) + if (order.CBM.ToString().Split('.').Count() > 1) { - value = order.CBM.ToString().Split('.')[0]; + value = string.Format("{0:F2}", order.CBM); } else { - value = string.Format("{0:F2}", order.CBM); - + value = order.CBM.ToString().Split('.')[0]; } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null)