Working with the table, I came across one problem, inside this table there are such data as:
- Item id
- Object name
- Object type
- Object coordinates
In point 4, where the coordinates of the object are written, the coordinates are too long, my task is to shorten this length:
Here is the table itself:
<table> <tr> <th>ID</th> <th>Name</th> <th>Type</th> <th>Coordinates</th> </tr> <tr> <td> <b><i>16</i></b> </td> <td> TestPoint1 </td> <td> Parking </td> <td> <span class="substring">40.381272280500674</span> : <span class="substring">49.842752143408234</span> </td> </tr> <tr> <td> <b><i>17</i></b> </td> <td> TestPoint2 </td> <td> Bankomat </td> <td> <span class="substring">40.382694313910996</span> : <span class="substring">49.84732262756961</span> </td> </tr> <tr> <td> <b><i>18</i></b> </td> <td> TestPoint3 </td> <td> Bank </td> <td> <span class="substring">40.379703105349265</span> : <span class="substring">49.84206549790042</span> </td> </tr> </table>
As you can see, the coordinates are long and you need to reduce their length.
I wrote a script using jQuery
$(".substring").substring(0,9);
This code does not work, or I'm doing something wrong. Please help to deal with the problem.