@@ -112,7 +112,7 @@ namespace UAS_MES.Make
{
weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
if (pr_cartonunit.Text == "kg")
- weight.Text = (double.Parse(weight.Text) / 1000).ToString();
+ weight.Text = (double.Parse(weight.Text == "" ? "0" : weight.Text) / 1000).ToString();
}
catch (Exception)