You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing an application that displays numbers in the form "1 hour", "2 hours", etc. and so using the ToQuantity method looked perfect. However the number of hours in this case is not a whole number, as the application supports half-hours too. This means I can't use ToQuantity as it only supports int or long as parameter types.
Could we have additional overloads to support decimal, double etc. parameter types for this method?
The text was updated successfully, but these errors were encountered:
AdamDawes
changed the title
Add support for non-numeric types with ToQuantity
Add support for non-integer types with ToQuantity
Jun 28, 2018
I have created a simple solution for this that accepts doubles and decimals, but only supports ShowQuantityAs.Numeric, e.g. 0.2 hour will return 0.2 hours.
I'm writing an application that displays numbers in the form "1 hour", "2 hours", etc. and so using the
ToQuantity
method looked perfect. However the number of hours in this case is not a whole number, as the application supports half-hours too. This means I can't useToQuantity
as it only supportsint
orlong
as parameter types.Could we have additional overloads to support
decimal
,double
etc. parameter types for this method?The text was updated successfully, but these errors were encountered: