CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    93

    exponential format

    When the function DoDataxchange() asign a value to an edit control, an this value is nearly Zero, it could write a infinitesimal value in exponential format, like this -4.2678911233e-19.
    How can I avoid this? I want that write 0.0 or at least 0.00000000000000426.

    Is necessary do it for any edit control, or can i configure all the application, and this Works in every edit control?


    Can someone help me, Thanks a .

    PERE

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: exponential format

    Nothing you can do directly.
    DDX_Text for a double uses a "%15.g" formatstring, and you can't influence that. It'll automatically figure out whether to use decimal or exponent notation.

    If you aren't happy with the way the default DDX_Text() works, you'll have to implement your own DDX function that does things the way you want them to.

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

    Re: exponential format

    Can you use float data member instead of double? Otherwise, just use CString type and write formatting/validation code manually.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured