This is a migrated thread and some comments may be shown as answers.

NumericTextBox - decimal formatting

1 Answer 527 Views
Input
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 30 Jan 2012, 06:14 PM
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"
        EnableSingleInputRendering="True">
   <NumberFormat AllowRounding="False" DecimalDigits="4" KeepNotRoundedValue="True"
           KeepTrailingZerosOnFocus="True"  />
</telerik:RadNumericTextBox>

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 31 Jan 2012, 06:22 AM
Hello Rayne,

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

Thanks,
Shinu.
Tags
Input
Asked by
Rayne
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or