We help IT Professionals succeed at work.

# enumerate decimals

on
Medium Priority
157 Views
I'm wondering if I'm understanding this correctly.

If I've got a movie admission class with the following enum

Public Enum AgeGroup
Toddler = 0.00
Student = 1.50
Military = 1.00
Senior = 1.00
End Enum

I get an error since option stict is on.  Other than turning it off, how would I set this up?
The error is ...implicit conversions from double to integer are disallowed...
Comment
Watch Question

## View Solution Only

High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
Enums can't hold decimals...

From here:

"An Enum is a named constant whose underlying type is any integral type except Char."

If you really want to use an Enum then I guess you could store the values like 150, 100, or 300 and then divide them by 100 to get the actual value.

Not the solution you were looking for? Getting a personalized solution is easy.

##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile