Sorting number with comma in react-bootstrap-table2
up vote
0
down vote
favorite
Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?
example

Cheers!
reactjs react-bootstrap-table
add a comment |
up vote
0
down vote
favorite
Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?
example

Cheers!
reactjs react-bootstrap-table
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
can you share your code?
– Tall Paul
Nov 9 at 18:20
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?
example

Cheers!
reactjs react-bootstrap-table
Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?
example

Cheers!
reactjs react-bootstrap-table
reactjs react-bootstrap-table
edited Nov 9 at 17:25
asked Nov 9 at 17:06
Gearóid
3416
3416
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
can you share your code?
– Tall Paul
Nov 9 at 18:20
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23
add a comment |
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
can you share your code?
– Tall Paul
Nov 9 at 18:20
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
can you share your code?
– Tall Paul
Nov 9 at 18:20
can you share your code?
– Tall Paul
Nov 9 at 18:20
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
add a comment |
up vote
1
down vote
accepted
Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.
Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.
answered Nov 9 at 20:18
mediaguru
499513
499513
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
add a comment |
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230331%2fsorting-number-with-comma-in-react-bootstrap-table2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42
can you share your code?
– Tall Paul
Nov 9 at 18:20
yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23