[CLOSED] Number field display DP

  1. #1

    [CLOSED] Number field display DP

    Guys

    I have a number field which is setup like below

    
    <ext:NumberField ID="_LossDeminimis" runat="server" AllowDecimals="true" Step="0.000000001" DecimalPrecision="9" MinValue="0.000000001" MaxValue="0.999999999" FieldLabel="Loss Deminimis" PaddingSpec="0 0 0 20" flex="1"></ext:NumberField>
    The issue is that in the front end it displays as "1e-9" which is not very user friendly, so I do I force it to display as "0.000000001"

    Ta,
    D
    Last edited by Daniil; Oct 17, 2014 at 8:45 AM. Reason: [CLOSED]
  2. #2
    Not to worry this can be closed as my user is quite happy working with the scientific notation.

    Ta,
    D
  3. #3
    Hi @CanopiusApplications,

    There is a property to turn it off if needed.
    http://docs.sencha.com/extjs/4.2.1/#...lowExponential
  4. #4
    Hi Danil

    Yeah I saw that but when I tried it I was still getting the the scientific notation.
    I have just given it another go but with no joy

    
    <ext:NumberField ID="_EPS" AllowBlank="false" AllowExponential="false" runat="server" AllowDecimals="true" Step="0.000000001" DecimalPrecision="9" MinValue="0.000000001" MaxValue="0.999999999" FieldLabel="EPS" PaddingSpec="0 0 0 20" flex="1"></ext:NumberField>
  5. #5
    It appears to be a JavaScript "feature". If you try to run
    alert(0.000000001);
    you will see "1e-9".
  6. #6
    Yeah I figured it to be something along those lines. .net formats it to the scientific notification by default as well when converting to string.
    no biggy though as the user is happy. a work around to use a text box and then convert tostring specifying the format

    num.tostring(0,000000000)

    this works but you lose the spinner capabilities of the number field and it requires additional validation.

    Either way this can be closed.


    Thanks again d, as always very helpful.

    D

Similar Threads

  1. Number Field changing value
    By caio.vidal in forum 2.x Help
    Replies: 1
    Last Post: Apr 10, 2013, 5:56 AM
  2. [CLOSED] Number Field
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 19
    Last Post: Jul 19, 2011, 8:59 AM
  3. Replies: 3
    Last Post: Jul 04, 2011, 3:57 AM
  4. [CLOSED] Number Field
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 05, 2011, 12:21 PM
  5. Number Field
    By fabiomarcos in forum 1.x Help
    Replies: 2
    Last Post: Jan 20, 2009, 11:29 AM

Posting Permissions