Formatting Numeric Text Box

2 posts, 0 answers
  1. Will
    Will avatar
    13 posts
    Member since:
    Jul 2013

    Posted 28 Jul 2015 Link to this post

    I am trying to format the numeric text box so that it allows up to 8 decimal places and will not show trailing 0's. However this is a currency field and we would only like to show trailing 0's for the first two decimal places ( 20.00 we want instead of 20). I cannot seem to satisfy all of these requirements with the numeric text box control. This is what I have.

    <telerik:RadNumericTextBox runat="server" EnabledStyle-HorizontalAlign="Right" ID="rtbPrice" NumberFormat-AllowRounding="False" NumberFormat-DecimalDigits="8" />​

     This will remove trailing 0's but will leave 20.00 showing as 20. Is there a way to do this?

  2. Viktor Tachev
    Viktor Tachev avatar
    2469 posts

    Posted 30 Jul 2015 Link to this post

    Hello Will,

    I am not sure I understand your scenario completely. If you would like to display only the first two decimal digits you should set the DecimalDigits property to 2.

    <telerik:RadNumericTextBox runat="server" EnabledStyle-HorizontalAlign="Right" ID="rtbPrice" NumberFormat-DecimalDigits="2" />​

    In case I have misunderstood what you would like to achieve please describe the scenario in more detail. What are the requirements and what should be the expected result?

    Viktor Tachev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top