kendoNumericTextBox currency value with 2 digit precision

6 posts, 0 answers
  1. Matei
    Matei avatar
    3 posts
    Member since:
    Jul 2012

    Posted 02 Jul 2012 Link to this post

    Good day,

    I have a numeric textbox which looks like this:
    $('#feeValue').width(250).kendoNumericTextBox({
    	format: 'c2'
    });

    My culture is "en-ZA".

    I need the textbox to allow me to change the cents value when I enter a currency amount.

    Right now if I enter "R 5,25", as soon as the textbox looses focus, it changes the value to "R 5,00". It doesn't seem to round down, because if I enter "R 5,85", it still then goes back to "R 5,00".

    I tried to set the "decimals: 2" parameter, and still nothing.
    Is it maybe a type of format I need to have to be able to edit the cent value of the amount?

    Can someone please point me in the right direction?

    Thank you for your help.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 05 Jul 2012 Link to this post

    Hello Matei,

     
    Thank you for drawing our attention to this issue. It seams that kendo.parseFloat method cannot parse
    "12,45" string, because the decimal separator for the non-currency numbers is ".". Only for the currency the deciamal separator is ",". The fix will be included in the next official release of KendoUI scheduled for the second week of July. I have updated your Telerik points because of the bug report.

    Regards,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Andres
    Andres avatar
    31 posts
    Member since:
    May 2011

    Posted 12 Sep 2012 Link to this post

    Hi, I'm having a similar problem with numeric values and es-CO culture. When I try to put a decimal separator "," in my culture ... eg: 2,45 becomes 245,00. I'm using kendo 2012.2.710

    Thanks in advance
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 13 Sep 2012 Link to this post

    Hello Andres,

     
    Did you set the current culture using the kendo.culture method? I could not reproduce the problem locally. Here is a simple jsBin demo.

    Regards,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Andres
    Andres avatar
    31 posts
    Member since:
    May 2011

    Posted 13 Sep 2012 Link to this post

    I'm using it as part of a grid popup editor with mvvm binding ... this is the input definition

    <script id="Hotel_editor" type="text/x-kendo-template">
    ....
    <
    input type="text" name="AccommodationIndex" data-bind="value:AccommodationIndex"  data-type="number" data-role="numerictextbox"  data-decimals="2" data-format="n2"  />
    ...
    </script>

    and this is my script initialisation 

    <script src="~/Scripts/kendo/2012.2.710/cultures/kendo.culture.es-CO.min.js"></script>
     
    <script type="text/javascript">
             kendo.culture("es-CO");
    </script>

  7. Andres
    Andres avatar
    31 posts
    Member since:
    May 2011

    Posted 13 Sep 2012 Link to this post

    It was my mistake, in the datasource schema I put the type as "string" and not as "number".

    Thanks.
Back to Top
Kendo UI is VS 2017 Ready