문제

I found this question: Why "decimal" is not a valid attribute parameter type? when I was searching for a solution to my original problem and understand that it is not an option, however, I am now curious as to how I should handle converting the value.

Would the best option be to just pass in doubles and then convert the attribute values to decimal or convert the property's value to double?

The actual implementation of the business logic is using IComparable so I have to do some sort of conversion. I am just not sure which way is best or if there was a neat workaround for handling the need for decimals in Attribute classes.

도움이 되었습니까?

해결책

Went with using a string to handle the rounding issues as Hans mentioned.

If anyone has a better idea, please answer this question and I will mark it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top