Forum /
Sencha Touch 2.x Forums /
Sencha Touch 2.x: Q&A /
Unanswered: How can I format floats in a list view which shows data from store?
Unanswered: How can I format floats in a list view which shows data from store?
My list view contains some floats from my store, but they contains "." as decimal point and the a variable number of zeros behind the dot.
How can I format them nicely, with a comma as seperator and only 2 decimals?
Best regards,
Stefan
http://www.sencha.com/learn/meet-the-list-component
At the End Drew Neil personalized the Title of the Detail Panel. This should do the trick for you, if you use a template and the functionality in your list.
And Stackoverflow says:
http://stackoverflow.com/questions/661562/how-to-format-a-float-in-javascript
var x = 5.0364342423;
print(x.toFixed(2));
will print 5.04.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us