This is a migrated thread and some comments may be shown as answers.
Get the formated value back to original
1 Answer 86 Views
This is a migrated thread and some comments may be shown as answers.
Office
Top achievements
Rank 1
Office asked on 19 Jan 2012, 11:09 AM
Hello,

I set my culture in Romanian input

kendo.culture('ro');

Then, i set the value of a textbox like this

$("#valueInput").val(kendo.toString(100000.25, "c"));  // creates "100.000,25 lei"

How can i get the formated value back to original, but keeping the culture format? (without using the .kendoNumericTextBox plugin)

For example, "100.000,25 lei"  changes to "100000,25"  (note that decimals separator is a coma , )

Thank you

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Jan 2012, 09:48 AM
Hello Mark,

 
Here is a quote of the answer in the support ticket open on the same matter:

Thank you for contacting us. In order to achieve your goal you will need first to parse the string and create Number from it. Then you can format it in the way you need:

Copy Code
//format to currency
var formatted = kendo.toString(100000.25, "c");
 
//get Number object
var currency = kendo.parseFloat(formatted );
 
//re-format the number
var newFomarttedNumber = kendo.toString(currency, "n");

Greetings,
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!
Asked by
Office
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or