NumericTextBox - decimal formatting

2 posts, 1 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 30 Jan 2012 Link to this post

    I need to always display 4 decimal places in my numeric textbox. I've set DecimalDigits = 4 and set Keep Trailing Zeros to True, but when control loses focus, the trailing zeros disappear. What do I need to set to always show 4 decimal places (with trailing zeros if needed)?

    Here is my code:

    <telerik:RadNumericTextBox runat="server" ID="Longitude" Width="75" EmptyMessage="Lon" Skin="Vista"
            AllowOutOfRangeAutoCorrect="False" MaxValue="0" DataType="System.Decimal"
       <NumberFormat AllowRounding="False" DecimalDigits="4" KeepNotRoundedValue="True"
               KeepTrailingZerosOnFocus="True"  />

  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Jan 2012 Link to this post

    Hello Rayne,

    In order to show trailing zeroes on losing focus, try setting AllowRounding property as true.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top