0

I'm Using Bootgrid to show some data. Now the data should be sorted by it's position and the position of it's category.

For example

  • Category position 1 and entry position 1 = 1.1
  • Category position 1 and entry position 2 = 1.2
  • Category position 1 and entry position 3 = 1.3
  • Category position 1 and entry position 10 = 1.10

now I get the wrong sort:

1.1

1.10

1.2

1.3

When I use parseFloat(value).toFixed(2) I get 1.10, 1.10, 1.20,...

It's also wrong. Got anyone an idea, how to manage this issue?

1.10 should be the last one in the row.

Archer
  • 1,062
  • 1
  • 13
  • 32
  • 1
    1.1 === 1.10... – baao Mar 22 '17 at 11:05
  • 1
    You need to split at point and compare the first and second values by themselves. – Yannici Mar 22 '17 at 11:08
  • maybe you should treat them like versions, try: http://stackoverflow.com/a/7717160/1595977 or http://stackoverflow.com/questions/6832596/how-to-compare-software-version-number-using-js-only-number – Edwin Mar 22 '17 at 11:09

0 Answers0