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

kendoNumericTextBox currency value with 2 digit precision

5 Answers 1148 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Matei
Top achievements
Rank 1
Matei asked on 02 Jul 2012, 08:53 AM
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.

5 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 05 Jul 2012, 01:33 PM
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!
0
Andres
Top achievements
Rank 1
answered on 12 Sep 2012, 08:34 PM
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
0
Georgi Krustev
Telerik team
answered on 13 Sep 2012, 02:48 PM
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!
0
Andres
Top achievements
Rank 1
answered on 13 Sep 2012, 05:16 PM
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>

0
Andres
Top achievements
Rank 1
answered on 13 Sep 2012, 08:01 PM
It was my mistake, in the datasource schema I put the type as "string" and not as "number".

Thanks.
Tags
NumericTextBox
Asked by
Matei
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Andres
Top achievements
Rank 1
Share this question
or