79209834

Date: 2024-11-21 05:54:37
Score: 0.5
Natty:
Report link
    public void fnDecimalOrganizer<T>(ref List<T> objEntItems, int iRowIndex)
    {
        var Item = objEntItems[iRowIndex];
        if (Item == null) return;

        var properties = typeof(T).GetProperties();
        foreach (var prop in properties)
        {
            Type type = prop.PropertyType;
            if (!type.Equals(typeof(System.Decimal)) || prop.Name.Contains("Cheque")) continue;
            if (prop.GetValue(Item).ToString().Trim().Length.Equals(0)) continue;

            prop.SetValue(Item, Convert.ToDecimal(String.Format("{0:0.00000}", prop.GetValue(Item))));
        }
    }    same issue
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user28408106