INPUT field - Financials calculations and display of comma for thousand (1,000) and decimal (.00)
For a website with financial calculations I try to convert every number included into an HTML input field to the format xxx,xxx,xxx.xx with comma for the thousand separator and point for decimal. Similar as we know it from Excel.
Now the challenge: the input fields are u开发者_JAVA技巧sed for the calculations in the form input fields.
So in paralytically the system would need to convert and revert every input field every time a user makes a changes in a field. This might cause some performance issues with 50+ fields on a website.
Is there solution to display the comma and point as a string, but keep it internally as a decimal digit without crazy hidden input fields etc?
Data are stored into MySQL database tables.
Technologies used: JS, jQuery, CSS, AJAX, MySQL
http://digitalbush.com/projects/masked-input-plugin/
you could use jQuery.data()
to store the numeric value on each of the elements, ref http://api.jquery.com/jQuery.data/
精彩评论