enumerate decimals

Posted on 2006-03-30
Last Modified: 2010-04-23
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
  Adult = 3.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...
Question by:sirbounty
    1 Comment
    LVL 85

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now