An E Notation Numeric Edit Control

NumEdit is a simple edit control that forces the user to enter a double value in e notation, such as 1.23, 12e4, -12E4, and so forth. The member functions GetValue() and SetValue() make working with doubles in the edit field a bit easier.

Just declare a variable as type CNumEdit, and off you go.

Download demo project - 28 KB

Download source - 2 KB

About the Author

Mike Scanlon



  • Thanks

    Posted by lukecodeguru on 02/22/2006 12:26am

    I appreciate that code. Thanks to you!

  • Thanks

    Posted by sangamesha on 10/28/2004 08:22am

    I found it is helpfull.

  • ExEditors Library

    Posted by Legacy on 03/19/2002 12:00am

    Originally posted by: Mike Philips

    A complete collection of editors in a single file:


  • NumEdit: for VC++ newbies

    Posted by Legacy on 08/08/2000 12:00am

    Originally posted by: Eric Hurtebis

    Many thanks for NumEdit: that's all what I was looking for...

    Just to tell about how I used it in my project:

    Copy the 2 files NumEdit.cpp and NumEdit.h in your project directory. Include them in your project (Project, Add).
    (the class CNumEdit will appear in ClassView).

    Add a Edit control in your dialog ressource.
    Add a member variable, CEdit type (e.g. m_x).

    In ClassView, class C...Dlg, double-click on m_x to modify C...Dlg.h:
    change CEdit m_x into CNumEdit m_x.
    also #include NumEdit.h

    In OnInitDialog, you can initialize m_x:

    Possible enhancements:
    the format string "%G" can be a private member; and can be user-tunable, e.g. "%8.3f", usable for SetValue or UpdateValue (for display, as soon as killfocus).


  • NumEdit

    Posted by Legacy on 03/07/2000 12:00am

    Originally posted by: Boris

    Found Bugs:
    1. on Paste - lets you make paste
    2. lets insert chars(numeric) before "-"

  • Thanks!

    Posted by Legacy on 12/03/1999 12:00am

    Originally posted by: Carlos Melo

    It's just what I need!
    Thanks a lot.
    Keep up the good work.

    Greetings from Portugal,

  • A bug found in CPrinter::PrintText(PRTTYPE *ps,double LineSpacing)

    Posted by Legacy on 04/23/1999 12:00am

    Originally posted by: Joseph Kiernan

    If you want to use display text in CScrollView::OnDraw(),
    you must change
    ps->pDC->LPtoDP((LPPOINT)&rc, 2);
    ==> ps->pDC->LPtoDP((CRect)rc);


    This may no work as intended. The cast to a CRect causes
    the RECT rc to be copied into a temporary object. This
    temp object is passed to the LP2DP(), changed, then
    discarded. The original rc is not changed! This has the
    exact same effect as not calling the LPtoDP at all.

    The proposed solution (or commenting out the LPtoDP) does
    seem to work for CScrollView but not for any print
    previews. The solution we ended up with (to support both
    view classes)was

    extern BOOL g_bUsingScrollView;
    if (! g_bUsingScrollView)

    // don't forget about LastPos at the end of the function

  • res dir added

    Posted by Legacy on 02/02/1999 12:00am

    Originally posted by: Mike Scanlon

    The res dir has been added to the demo project.

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Entire organizations suffer when their networks can't keep up and new opportunities are put on hold. Waiting on service providers isn't good business. In these examples, learn how to simplify network management so that your organization can better manage costs, adapt quickly to business demands, and seize market opportunities when they arise.

  • Featuring Mary Wardley, VP, Enterprise Applications and CRM Software, IDC Live Event Date: Wednesday, November 16, 2016 10 AM PT / 1 PM ET Significant changes are coming to the contact center, with new technologies enabling better customer engagement, innovative journey analytics and streamlined proactive communications. But the future holds some amazing advances which will change the role of the contact center in tomorrow's organizations. This is a critical time to understand what's coming and how an agile …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date