mirror of
https://github.com/DataTables/DataTables.git
synced 2024-11-29 11:24:10 +01:00
afdf67075d
DataTables which character is used as a decimal place in the table's data, so that number which are formatted using characters other than a dot as the decimal place can be correctly detected and sorted. - A large part of the world uses the comma as a decimal place, so it makes sense to have this option built-in directly to DataTables, rather than needing to use plu-in sorting types as before: http://en.wikipedia.org/wiki/Decimal_mark - However, the decimal place character cannot be detected automatically since there are far to many ambiguities. As such, a new `language.decimal` option is defined which is passed through to the type detection functions. The type detection functions can then use that character to alter their detection functions to transform numbers into the dot formatted equivilent for parsing in Javascript. - The numeric sorting methods have been bundled together in the function `_addNumericSort` which is called when a character is given for the decimal mark, adding the sorting functions required specifically for that mark. This means that any character at all can be added, while keeping the table's sort performance as it was. - Code size in increased a little for this new feature, but a lot of work has been done to keep it to a minimum (while still optimising for the most common use case of a dot decimal place), and this is a good feature to have in DataTables' core code. - All required documentation added and updated. - Special thanks to Tobias Bäthge for suggesting and sponsoring this feature. |
||
---|---|---|
.. | ||
advanced_init | ||
ajax | ||
api | ||
basic_init | ||
data_sources | ||
plug-ins | ||
resources | ||
server_side | ||
styling | ||
index.html |