Need to enter a positive or negative decimal which does NOT display scientific notation

إجابة مقترحة Need to enter a positive or negative decimal which does NOT display scientific notation

  • Wednesday, May 16, 2012 11:38 PM
     
     

    Hello,

    I have a regex for decimals:

    [-+]?((\d+(\.\d*)?)|\.\d+)?

    This works.  But I want the values to NOT display in scientfic notation.

    So, any number from -9999999999.99999999999 to 9999999999999.999999999999999 is valid

    But, if user enters .000001 I want it to display as .000001 not as .01E-6 (or whatever the result is)

    Any help greatly appreciated.

    Thanks,

    Dan

All Replies

  • Thursday, May 17, 2012 10:05 AM
     
     

    Hi Lesotho,

    Where do you input the number?

    Have a nice day.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

  • Thursday, May 17, 2012 3:45 PM
     
     

    Hi Ghost,

    Thanks for responding. 

    I am entering this into a DevExpress ASPxGridView.  Connecting to a SQL Server database where the data is stored in scientifc notation.  i.e. 2E-07.

    So, I'm guessing this is an issue with the devexpress textbox not having correct formatting and nothing to do with the regex, eh?  Sorry, should have thought of that initially.

    Thanks,

    Dan

  • Friday, May 18, 2012 7:29 AM
     
     Proposed Answer

    Hi Dan,

    Yes, I think so.

    I suggest you try to ask this issue on asp.net forum: http://forums.asp.net/ 

    And I moved this thread to off-topic forum.

    Thank you for your understanding and support.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.