c# Enum with decimals?

Started by
1 comment, last by doynax 18 years, 11 months ago
hey, Im trying to make a enum with some values being floating point values, any ideas on how to do something like that? thanks
Advertisement
No.

From the MSDN:
Quote:An enumeration (enum) is a special form of value type, which inherits from System.Enum and supplies alternate names for the values of an underlying primitive type. An enumeration type has a name, an underlying type, and a set of fields. The underlying type must be one of the built-in signed or unsigned integer types (such as Byte, Int32, or UInt64). The fields are static literal fields, each of which represents a constant. The same value can be assigned to multiple fields. When this occurs, you must mark one of the values as the primary enumeration value for purposes of reflection and string conversion.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Or you could use (decimal) fixed point numbers and convert them when used.
At least I've done that a few times..

This topic is closed to new replies.

Advertisement